Align SQL Server-related class names with existing precedents

Closes gh-35181
This commit is contained in:
Andy Wilkinson
2023-04-26 17:54:30 +01:00
parent 1e785e81f8
commit 5e73047164
9 changed files with 33 additions and 34 deletions

View File

@@ -25,39 +25,39 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
/**
* Tests for {@link MsSqlServerEnvironment}.
* Tests for {@link SqlServerEnvironment}.
*
* @author Andy Wilkinson
*/
class MsSqlServerEnvironmentTests {
class SqlServerEnvironmentTests {
@Test
void createWhenHasNoPasswordThrowsException() {
assertThatIllegalStateException().isThrownBy(() -> new MsSqlServerEnvironment(Collections.emptyMap()))
assertThatIllegalStateException().isThrownBy(() -> new SqlServerEnvironment(Collections.emptyMap()))
.withMessage("No MSSQL password found");
}
@Test
void getUsernameWhenHasNoMsSqlUser() {
MsSqlServerEnvironment environment = new MsSqlServerEnvironment(Map.of("MSSQL_SA_PASSWORD", "secret"));
SqlServerEnvironment environment = new SqlServerEnvironment(Map.of("MSSQL_SA_PASSWORD", "secret"));
assertThat(environment.getUsername()).isEqualTo("SA");
}
@Test
void getPasswordWhenHasMsSqlSaPassword() {
MsSqlServerEnvironment environment = new MsSqlServerEnvironment(Map.of("MSSQL_SA_PASSWORD", "secret"));
SqlServerEnvironment environment = new SqlServerEnvironment(Map.of("MSSQL_SA_PASSWORD", "secret"));
assertThat(environment.getPassword()).isEqualTo("secret");
}
@Test
void getPasswordWhenHasSaPassword() {
MsSqlServerEnvironment environment = new MsSqlServerEnvironment(Map.of("SA_PASSWORD", "secret"));
SqlServerEnvironment environment = new SqlServerEnvironment(Map.of("SA_PASSWORD", "secret"));
assertThat(environment.getPassword()).isEqualTo("secret");
}
@Test
void getPasswordWhenHasMsSqlSaPasswordAndSaPasswordPrefersMsSqlSaPassword() {
MsSqlServerEnvironment environment = new MsSqlServerEnvironment(
SqlServerEnvironment environment = new SqlServerEnvironment(
Map.of("MSSQL_SA_PASSWORD", "secret", "SA_PASSWORD", "not used"));
assertThat(environment.getPassword()).isEqualTo("secret");
}

View File

@@ -30,14 +30,13 @@ import org.springframework.util.ClassUtils;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Integration tests for {@link MsSqlServerJdbcDockerComposeConnectionDetailsFactory}
* Integration tests for {@link SqlServerJdbcDockerComposeConnectionDetailsFactory}
*
* @author Andy Wilkinson
*/
class MsSqlServerJdbcDockerComposeConnectionDetailsFactoryIntegrationTests
extends AbstractDockerComposeIntegrationTests {
class SqlServerJdbcDockerComposeConnectionDetailsFactoryIntegrationTests extends AbstractDockerComposeIntegrationTests {
MsSqlServerJdbcDockerComposeConnectionDetailsFactoryIntegrationTests() {
SqlServerJdbcDockerComposeConnectionDetailsFactoryIntegrationTests() {
super("mssqlserver-compose.yaml");
}

View File

@@ -28,14 +28,14 @@ import org.springframework.r2dbc.core.DatabaseClient;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Integration tests for {@link MsSqlServerR2dbcDockerComposeConnectionDetailsFactory}
* Integration tests for {@link SqlServerR2dbcDockerComposeConnectionDetailsFactory}
*
* @author Andy Wilkinson
*/
class MsSqlServerR2dbcDockerComposeConnectionDetailsFactoryIntegrationTests
class SqlServerR2dbcDockerComposeConnectionDetailsFactoryIntegrationTests
extends AbstractDockerComposeIntegrationTests {
MsSqlServerR2dbcDockerComposeConnectionDetailsFactoryIntegrationTests() {
SqlServerR2dbcDockerComposeConnectionDetailsFactoryIntegrationTests() {
super("mssqlserver-compose.yaml");
}