diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/sqlserver/MsSqlServerEnvironment.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/sqlserver/SqlServerEnvironment.java similarity index 94% rename from spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/sqlserver/MsSqlServerEnvironment.java rename to spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/sqlserver/SqlServerEnvironment.java index b895efbe6e..eb4dc0e3c1 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/sqlserver/MsSqlServerEnvironment.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/sqlserver/SqlServerEnvironment.java @@ -26,13 +26,13 @@ import org.springframework.util.StringUtils; * * @author Andy Wilkinson */ -class MsSqlServerEnvironment { +class SqlServerEnvironment { private final String username = "SA"; private final String password; - MsSqlServerEnvironment(Map env) { + SqlServerEnvironment(Map env) { this.password = extractPassword(env); } diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/sqlserver/MsSqlServerJdbcDockerComposeConnectionDetailsFactory.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/sqlserver/SqlServerJdbcDockerComposeConnectionDetailsFactory.java similarity index 83% rename from spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/sqlserver/MsSqlServerJdbcDockerComposeConnectionDetailsFactory.java rename to spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/sqlserver/SqlServerJdbcDockerComposeConnectionDetailsFactory.java index ebd204bf9c..90d68b909f 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/sqlserver/MsSqlServerJdbcDockerComposeConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/sqlserver/SqlServerJdbcDockerComposeConnectionDetailsFactory.java @@ -28,34 +28,34 @@ import org.springframework.boot.docker.compose.service.connection.jdbc.JdbcUrlBu * * @author Andy Wilkinson */ -class MsSqlServerJdbcDockerComposeConnectionDetailsFactory +class SqlServerJdbcDockerComposeConnectionDetailsFactory extends DockerComposeConnectionDetailsFactory { - protected MsSqlServerJdbcDockerComposeConnectionDetailsFactory() { + protected SqlServerJdbcDockerComposeConnectionDetailsFactory() { super("mssql/server"); } @Override protected JdbcConnectionDetails getDockerComposeConnectionDetails(DockerComposeConnectionSource source) { - return new MsSqlJdbcDockerComposeConnectionDetails(source.getRunningService()); + return new SqlServerJdbcDockerComposeConnectionDetails(source.getRunningService()); } /** * {@link JdbcConnectionDetails} backed by a {@code mssql/server} * {@link RunningService}. */ - static class MsSqlJdbcDockerComposeConnectionDetails extends DockerComposeConnectionDetails + static class SqlServerJdbcDockerComposeConnectionDetails extends DockerComposeConnectionDetails implements JdbcConnectionDetails { private static final JdbcUrlBuilder jdbcUrlBuilder = new JdbcUrlBuilder("sqlserver", 1433); - private final MsSqlServerEnvironment environment; + private final SqlServerEnvironment environment; private final String jdbcUrl; - MsSqlJdbcDockerComposeConnectionDetails(RunningService service) { + SqlServerJdbcDockerComposeConnectionDetails(RunningService service) { super(service); - this.environment = new MsSqlServerEnvironment(service.env()); + this.environment = new SqlServerEnvironment(service.env()); this.jdbcUrl = disableEncryptionIfNecessary(jdbcUrlBuilder.build(service, "")); } diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/sqlserver/MsSqlServerR2dbcDockerComposeConnectionDetailsFactory.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/sqlserver/SqlServerR2dbcDockerComposeConnectionDetailsFactory.java similarity index 83% rename from spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/sqlserver/MsSqlServerR2dbcDockerComposeConnectionDetailsFactory.java rename to spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/sqlserver/SqlServerR2dbcDockerComposeConnectionDetailsFactory.java index 5cfaf28c0d..e0e78b7896 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/sqlserver/MsSqlServerR2dbcDockerComposeConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/sqlserver/SqlServerR2dbcDockerComposeConnectionDetailsFactory.java @@ -32,22 +32,22 @@ import org.springframework.boot.docker.compose.service.connection.r2dbc.Connecti * @author Andy Wilkinson * @author Phillip Webb */ -class MsSqlServerR2dbcDockerComposeConnectionDetailsFactory +class SqlServerR2dbcDockerComposeConnectionDetailsFactory extends DockerComposeConnectionDetailsFactory { - MsSqlServerR2dbcDockerComposeConnectionDetailsFactory() { + SqlServerR2dbcDockerComposeConnectionDetailsFactory() { super("mssql/server", "io.r2dbc.spi.ConnectionFactoryOptions"); } @Override protected R2dbcConnectionDetails getDockerComposeConnectionDetails(DockerComposeConnectionSource source) { - return new MsSqlR2dbcDockerComposeConnectionDetails(source.getRunningService()); + return new SqlServerR2dbcDockerComposeConnectionDetails(source.getRunningService()); } /** * {@link R2dbcConnectionDetails} backed by a {@code mssql} {@link RunningService}. */ - static class MsSqlR2dbcDockerComposeConnectionDetails extends DockerComposeConnectionDetails + static class SqlServerR2dbcDockerComposeConnectionDetails extends DockerComposeConnectionDetails implements R2dbcConnectionDetails { private static final ConnectionFactoryOptionsBuilder connectionFactoryOptionsBuilder = new ConnectionFactoryOptionsBuilder( @@ -55,9 +55,9 @@ class MsSqlServerR2dbcDockerComposeConnectionDetailsFactory private final ConnectionFactoryOptions connectionFactoryOptions; - MsSqlR2dbcDockerComposeConnectionDetails(RunningService service) { + SqlServerR2dbcDockerComposeConnectionDetails(RunningService service) { super(service); - MsSqlServerEnvironment environment = new MsSqlServerEnvironment(service.env()); + SqlServerEnvironment environment = new SqlServerEnvironment(service.env()); this.connectionFactoryOptions = connectionFactoryOptionsBuilder.build(service, "", environment.getUsername(), environment.getPassword()); } diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot-docker-compose/src/main/resources/META-INF/spring.factories index 3182f98451..0060464f91 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/resources/META-INF/spring.factories +++ b/spring-boot-project/spring-boot-docker-compose/src/main/resources/META-INF/spring.factories @@ -17,6 +17,6 @@ org.springframework.boot.docker.compose.service.connection.postgres.PostgresJdbc org.springframework.boot.docker.compose.service.connection.postgres.PostgresR2dbcDockerComposeConnectionDetailsFactory,\ org.springframework.boot.docker.compose.service.connection.rabbit.RabbitDockerComposeConnectionDetailsFactory,\ org.springframework.boot.docker.compose.service.connection.redis.RedisDockerComposeConnectionDetailsFactory,\ -org.springframework.boot.docker.compose.service.connection.sqlserver.MsSqlServerJdbcDockerComposeConnectionDetailsFactory,\ -org.springframework.boot.docker.compose.service.connection.sqlserver.MsSqlServerR2dbcDockerComposeConnectionDetailsFactory,\ +org.springframework.boot.docker.compose.service.connection.sqlserver.SqlServerJdbcDockerComposeConnectionDetailsFactory,\ +org.springframework.boot.docker.compose.service.connection.sqlserver.SqlServerR2dbcDockerComposeConnectionDetailsFactory,\ org.springframework.boot.docker.compose.service.connection.zipkin.ZipkinDockerComposeConnectionDetailsFactory diff --git a/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/sqlserver/MsSqlServerEnvironmentTests.java b/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/sqlserver/SqlServerEnvironmentTests.java similarity index 74% rename from spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/sqlserver/MsSqlServerEnvironmentTests.java rename to spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/sqlserver/SqlServerEnvironmentTests.java index cd6b63b224..5d0ccb2e51 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/sqlserver/MsSqlServerEnvironmentTests.java +++ b/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/sqlserver/SqlServerEnvironmentTests.java @@ -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"); } diff --git a/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/sqlserver/MsSqlServerJdbcDockerComposeConnectionDetailsFactoryIntegrationTests.java b/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/sqlserver/SqlServerJdbcDockerComposeConnectionDetailsFactoryIntegrationTests.java similarity index 88% rename from spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/sqlserver/MsSqlServerJdbcDockerComposeConnectionDetailsFactoryIntegrationTests.java rename to spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/sqlserver/SqlServerJdbcDockerComposeConnectionDetailsFactoryIntegrationTests.java index a9d6d0e101..59449724e2 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/sqlserver/MsSqlServerJdbcDockerComposeConnectionDetailsFactoryIntegrationTests.java +++ b/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/sqlserver/SqlServerJdbcDockerComposeConnectionDetailsFactoryIntegrationTests.java @@ -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"); } diff --git a/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/sqlserver/MsSqlServerR2dbcDockerComposeConnectionDetailsFactoryIntegrationTests.java b/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/sqlserver/SqlServerR2dbcDockerComposeConnectionDetailsFactoryIntegrationTests.java similarity index 89% rename from spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/sqlserver/MsSqlServerR2dbcDockerComposeConnectionDetailsFactoryIntegrationTests.java rename to spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/sqlserver/SqlServerR2dbcDockerComposeConnectionDetailsFactoryIntegrationTests.java index dcc888a187..7ac94dc38a 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/sqlserver/MsSqlServerR2dbcDockerComposeConnectionDetailsFactoryIntegrationTests.java +++ b/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/sqlserver/SqlServerR2dbcDockerComposeConnectionDetailsFactoryIntegrationTests.java @@ -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"); } diff --git a/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/r2dbc/MsSqlServerR2dbcContainerConnectionDetailsFactory.java b/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/r2dbc/SqlServerR2dbcContainerConnectionDetailsFactory.java similarity index 95% rename from spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/r2dbc/MsSqlServerR2dbcContainerConnectionDetailsFactory.java rename to spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/r2dbc/SqlServerR2dbcContainerConnectionDetailsFactory.java index 0fbe7c0596..44916da73e 100644 --- a/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/r2dbc/MsSqlServerR2dbcContainerConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/r2dbc/SqlServerR2dbcContainerConnectionDetailsFactory.java @@ -33,10 +33,10 @@ import org.springframework.boot.testcontainers.service.connection.ServiceConnect * @author Andy Wilkinson * @author Phillip Webb */ -class MsSqlServerR2dbcContainerConnectionDetailsFactory +class SqlServerR2dbcContainerConnectionDetailsFactory extends ContainerConnectionDetailsFactory> { - MsSqlServerR2dbcContainerConnectionDetailsFactory() { + SqlServerR2dbcContainerConnectionDetailsFactory() { super(ANY_CONNECTION_NAME, "io.r2dbc.spi.ConnectionFactoryOptions"); } diff --git a/spring-boot-project/spring-boot-testcontainers/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot-testcontainers/src/main/resources/META-INF/spring.factories index aad843c3b4..d7f0dfb531 100644 --- a/spring-boot-project/spring-boot-testcontainers/src/main/resources/META-INF/spring.factories +++ b/spring-boot-project/spring-boot-testcontainers/src/main/resources/META-INF/spring.factories @@ -20,7 +20,7 @@ org.springframework.boot.testcontainers.service.connection.liquibase.LiquibaseCo org.springframework.boot.testcontainers.service.connection.mongo.MongoContainerConnectionDetailsFactory,\ org.springframework.boot.testcontainers.service.connection.neo4j.Neo4jContainerConnectionDetailsFactory,\ org.springframework.boot.testcontainers.service.connection.r2dbc.MariaDbR2dbcContainerConnectionDetailsFactory,\ -org.springframework.boot.testcontainers.service.connection.r2dbc.MsSqlServerR2dbcContainerConnectionDetailsFactory,\ +org.springframework.boot.testcontainers.service.connection.r2dbc.SqlServerR2dbcContainerConnectionDetailsFactory,\ org.springframework.boot.testcontainers.service.connection.r2dbc.MySqlR2dbcContainerConnectionDetailsFactory,\ org.springframework.boot.testcontainers.service.connection.r2dbc.OracleR2dbcContainerConnectionDetailsFactory,\ org.springframework.boot.testcontainers.service.connection.r2dbc.PostgresR2dbcContainerConnectionDetailsFactory,\