File tree Expand file tree Collapse file tree 11 files changed +31
-50
lines changed
src/test/java/org/springframework/data/jdbc/testing
src/test/java/org/springframework/data/r2dbc/testing Expand file tree Collapse file tree 11 files changed +31
-50
lines changed Original file line number Diff line number Diff line change 2323 <project .root>${basedir} /..</project .root>
2424 </properties >
2525
26- <dependencyManagement >
27- <dependencies >
28- <dependency >
29- <groupId >org.testcontainers</groupId >
30- <artifactId >testcontainers-bom</artifactId >
31- <version >${testcontainers} </version >
32- <type >pom</type >
33- <scope >import</scope >
34- </dependency >
35- </dependencies >
36- </dependencyManagement >
37-
3826 <dependencies >
3927
4028 <dependency >
250238
251239 <dependency >
252240 <groupId >org.testcontainers</groupId >
253- <artifactId >mysql</artifactId >
241+ <artifactId >testcontainers- mysql</artifactId >
254242 <scope >test</scope >
255243 <exclusions >
256244 <exclusion >
262250
263251 <dependency >
264252 <groupId >org.testcontainers</groupId >
265- <artifactId >postgresql</artifactId >
253+ <artifactId >testcontainers- postgresql</artifactId >
266254 <scope >test</scope >
267255 </dependency >
268256
269257 <dependency >
270258 <groupId >org.testcontainers</groupId >
271- <artifactId >mariadb</artifactId >
259+ <artifactId >testcontainers- mariadb</artifactId >
272260 <scope >test</scope >
273261 </dependency >
274262
275263 <dependency >
276264 <groupId >org.testcontainers</groupId >
277- <artifactId >mssqlserver</artifactId >
265+ <artifactId >testcontainers- mssqlserver</artifactId >
278266 <scope >test</scope >
279267 </dependency >
280268
281269 <dependency >
282270 <groupId >org.testcontainers</groupId >
283- <artifactId >db2</artifactId >
271+ <artifactId >testcontainers- db2</artifactId >
284272 <scope >test</scope >
285273 </dependency >
286274
287275 <dependency >
288276 <groupId >org.testcontainers</groupId >
289- <artifactId >oracle-free</artifactId >
277+ <artifactId >testcontainers- oracle-free</artifactId >
290278 <scope >test</scope >
291279 </dependency >
292280
Original file line number Diff line number Diff line change 2323import org .springframework .core .env .Environment ;
2424import org .springframework .jdbc .datasource .DriverManagerDataSource ;
2525import org .springframework .jdbc .datasource .init .ResourceDatabasePopulator ;
26- import org .testcontainers .containers .Db2Container ;
26+ import org .testcontainers .db2 .Db2Container ;
2727
2828/**
2929 * {@link DataSource} setup for DB2.
Original file line number Diff line number Diff line change 2626import org .springframework .core .env .Environment ;
2727import org .springframework .core .io .ByteArrayResource ;
2828import org .springframework .jdbc .datasource .init .ScriptUtils ;
29- import org .testcontainers .containers .MariaDBContainer ;
29+ import org .testcontainers .mariadb .MariaDBContainer ;
3030
3131/**
3232 * {@link DataSource} setup for MariaDB. Starts a Docker-container with a MariaDB database, and sets up database "test".
3939@ ConditionalOnDatabase (DatabaseType .MARIADB )
4040class MariaDBDataSourceConfiguration extends DataSourceConfiguration implements InitializingBean {
4141
42- private static MariaDBContainer <?> MARIADB_CONTAINER ;
42+ private static MariaDBContainer MARIADB_CONTAINER ;
4343
4444 public MariaDBDataSourceConfiguration (TestClass testClass , Environment environment ) {
4545 super (testClass , environment );
@@ -50,7 +50,7 @@ protected DataSource createDataSource() {
5050
5151 if (MARIADB_CONTAINER == null ) {
5252
53- MariaDBContainer <?> container = new MariaDBContainer <> ("mariadb:10.8.3" ).withUsername ("root" ).withPassword ("" )
53+ MariaDBContainer container = new MariaDBContainer ("mariadb:10.8.3" ).withUsername ("root" ).withPassword ("" )
5454 .withConfigurationOverride ("" );
5555 container .start ();
5656
Original file line number Diff line number Diff line change 2020import org .springframework .context .annotation .Configuration ;
2121import org .springframework .core .env .Environment ;
2222import org .springframework .jdbc .datasource .init .ResourceDatabasePopulator ;
23- import org .testcontainers .containers .MSSQLServerContainer ;
23+ import org .testcontainers .mssqlserver .MSSQLServerContainer ;
2424
2525import com .microsoft .sqlserver .jdbc .SQLServerDataSource ;
2626
3939public class MsSqlDataSourceConfiguration extends DataSourceConfiguration {
4040
4141 public static final String MS_SQL_SERVER_VERSION = "mcr.microsoft.com/mssql/server:2022-latest" ;
42- private static MSSQLServerContainer <?> MSSQL_CONTAINER ;
42+ private static MSSQLServerContainer MSSQL_CONTAINER ;
4343
4444 public MsSqlDataSourceConfiguration (TestClass testClass , Environment environment ) {
4545 super (testClass , environment );
@@ -50,7 +50,7 @@ protected DataSource createDataSource() {
5050
5151 if (MSSQL_CONTAINER == null ) {
5252
53- MSSQLServerContainer <?> container = new MSSQLServerContainer <> (MS_SQL_SERVER_VERSION ) //
53+ MSSQLServerContainer container = new MSSQLServerContainer (MS_SQL_SERVER_VERSION ) //
5454 .withReuse (true );
5555 container .start ();
5656
Original file line number Diff line number Diff line change 2424import org .springframework .core .env .Environment ;
2525import org .springframework .core .io .ByteArrayResource ;
2626import org .springframework .jdbc .datasource .init .ScriptUtils ;
27- import org .testcontainers .containers .MySQLContainer ;
27+ import org .testcontainers .mysql .MySQLContainer ;
2828
2929import com .mysql .cj .jdbc .MysqlDataSource ;
3030
4141@ ConditionalOnDatabase (DatabaseType .MYSQL )
4242class MySqlDataSourceConfiguration extends DataSourceConfiguration implements InitializingBean {
4343
44- private static MySQLContainer <?> MYSQL_CONTAINER ;
44+ private static MySQLContainer MYSQL_CONTAINER ;
4545
4646 public MySqlDataSourceConfiguration (TestClass testClass , Environment environment ) {
4747 super (testClass , environment );
@@ -52,7 +52,7 @@ protected DataSource createDataSource() {
5252
5353 if (MYSQL_CONTAINER == null ) {
5454
55- MySQLContainer <?> container = new MySQLContainer <> ("mysql:8.0.29" ).withUsername ("test" ).withPassword ("test" )
55+ MySQLContainer container = new MySQLContainer ("mysql:8.0.29" ).withUsername ("test" ).withPassword ("test" )
5656 .withConfigurationOverride ("" );
5757
5858 container .start ();
Original file line number Diff line number Diff line change 2121import org .springframework .context .annotation .Configuration ;
2222import org .springframework .core .env .Environment ;
2323import org .springframework .jdbc .datasource .init .ResourceDatabasePopulator ;
24- import org .testcontainers .containers .PostgreSQLContainer ;
24+ import org .testcontainers .postgresql .PostgreSQLContainer ;
2525
2626/**
2727 * {@link DataSource} setup for PostgreSQL. Starts a docker container with a Postgres database.
3535@ ConditionalOnDatabase (DatabaseType .POSTGRES )
3636public class PostgresDataSourceConfiguration extends DataSourceConfiguration {
3737
38- private static PostgreSQLContainer <?> POSTGRESQL_CONTAINER ;
38+ private static PostgreSQLContainer POSTGRESQL_CONTAINER ;
3939
4040 public PostgresDataSourceConfiguration (TestClass testClass , Environment environment ) {
4141 super (testClass , environment );
@@ -46,7 +46,7 @@ protected DataSource createDataSource() {
4646
4747 if (POSTGRESQL_CONTAINER == null ) {
4848
49- PostgreSQLContainer <?> container = new PostgreSQLContainer <> ("postgres:14.3" );
49+ PostgreSQLContainer container = new PostgreSQLContainer ("postgres:14.3" );
5050 container .start ();
5151
5252 POSTGRESQL_CONTAINER = container ;
Original file line number Diff line number Diff line change 3535
3636 <dependencyManagement >
3737 <dependencies >
38- <dependency >
39- <groupId >org.testcontainers</groupId >
40- <artifactId >testcontainers-bom</artifactId >
41- <version >${testcontainers} </version >
42- <type >pom</type >
43- <scope >import</scope >
44- </dependency >
4538 <dependency >
4639 <groupId >io.netty</groupId >
4740 <artifactId >netty-bom</artifactId >
249242
250243 <dependency >
251244 <groupId >org.testcontainers</groupId >
252- <artifactId >mysql</artifactId >
245+ <artifactId >testcontainers- mysql</artifactId >
253246 <scope >test</scope >
254247 <exclusions >
255248 <exclusion >
261254
262255 <dependency >
263256 <groupId >org.testcontainers</groupId >
264- <artifactId >mariadb</artifactId >
257+ <artifactId >testcontainers- mariadb</artifactId >
265258 <scope >test</scope >
266259 <exclusions >
267260 <exclusion >
273266
274267 <dependency >
275268 <groupId >org.testcontainers</groupId >
276- <artifactId >mssqlserver</artifactId >
269+ <artifactId >testcontainers- mssqlserver</artifactId >
277270 <scope >test</scope >
278271 <exclusions >
279272 <exclusion >
285278
286279 <dependency >
287280 <groupId >org.testcontainers</groupId >
288- <artifactId >oracle-free</artifactId >
281+ <artifactId >testcontainers- oracle-free</artifactId >
289282 <scope >test</scope >
290283 </dependency >
291284
292285 <dependency >
293286 <groupId >org.testcontainers</groupId >
294- <artifactId >postgresql</artifactId >
287+ <artifactId >testcontainers- postgresql</artifactId >
295288 <scope >test</scope >
296289 </dependency >
297290
Original file line number Diff line number Diff line change 2727import org .mariadb .jdbc .MariaDbDataSource ;
2828import org .mariadb .r2dbc .MariadbConnectionFactoryProvider ;
2929import org .springframework .data .r2dbc .testing .ExternalDatabase .ProvidedDatabase ;
30- import org .testcontainers .containers .MariaDBContainer ;
30+ import org .testcontainers .mariadb .MariaDBContainer ;
3131import org .testcontainers .utility .DockerImageName ;
3232
3333/**
@@ -123,7 +123,7 @@ private static ExternalDatabase testContainer() {
123123 .asCompatibleSubstituteFor ("mariadb" );
124124
125125 DockerImageName mariadb = DockerImageName .parse ("mariadb" ).withTag ("10.3.6" );
126- var container = new MariaDBContainer <> ("aarch64" .equals (osArch ) ? armImageName : mariadb );
126+ var container = new MariaDBContainer ("aarch64" .equals (osArch ) ? armImageName : mariadb );
127127
128128 container .start ();
129129
Original file line number Diff line number Diff line change 2525import javax .sql .DataSource ;
2626
2727import org .springframework .data .r2dbc .testing .ExternalDatabase .ProvidedDatabase ;
28- import org .testcontainers .containers .MySQLContainer ;
28+ import org .testcontainers .mysql .MySQLContainer ;
2929
3030import com .mysql .cj .jdbc .MysqlDataSource ;
3131
@@ -116,7 +116,7 @@ private static ExternalDatabase testContainer() {
116116
117117 try {
118118
119- var container = new MySQLContainer <> ("mysql:8.0.32" ).withUsername ("test" ).withPassword ("test" )
119+ var container = new MySQLContainer ("mysql:8.0.32" ).withUsername ("test" ).withPassword ("test" )
120120 .withConfigurationOverride ("" );
121121
122122 container .start ();
Original file line number Diff line number Diff line change 2424
2525import org .postgresql .ds .PGSimpleDataSource ;
2626import org .springframework .data .r2dbc .testing .ExternalDatabase .ProvidedDatabase ;
27- import org .testcontainers .containers .PostgreSQLContainer ;
27+ import org .testcontainers .postgresql .PostgreSQLContainer ;
2828
2929/**
3030 * Utility class for testing against Postgres.
You can’t perform that action at this time.
0 commit comments