Skip to content

Commit b6f3a7f

Browse files
committed
Upgrade to Testcontainers 2.0.
See spring-projects/spring-data-build#2688
1 parent ef61e29 commit b6f3a7f

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

spring-data-jpa/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150

151151
<dependency>
152152
<groupId>org.testcontainers</groupId>
153-
<artifactId>mysql</artifactId>
153+
<artifactId>testcontainers-mysql</artifactId>
154154
<scope>test</scope>
155155
<exclusions>
156156
<exclusion>
@@ -170,7 +170,7 @@
170170

171171
<dependency>
172172
<groupId>org.testcontainers</groupId>
173-
<artifactId>postgresql</artifactId>
173+
<artifactId>testcontainers-postgresql</artifactId>
174174
<scope>test</scope>
175175
</dependency>
176176

@@ -192,7 +192,7 @@
192192

193193
<dependency>
194194
<groupId>org.testcontainers</groupId>
195-
<artifactId>oracle-free</artifactId>
195+
<artifactId>testcontainers-oracle-free</artifactId>
196196
<scope>test</scope>
197197
</dependency>
198198

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/PgVectorIntegrationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import org.springframework.test.context.junit.jupiter.SpringExtension;
3434
import org.springframework.transaction.annotation.EnableTransactionManagement;
3535

36-
import org.testcontainers.containers.PostgreSQLContainer;
36+
import org.testcontainers.postgresql.PostgreSQLContainer;
3737

3838
/**
3939
* Testcase to verify Vector Search work with Postgres (PGvector).
@@ -81,9 +81,9 @@ public List<String> getManagedPackages() {
8181

8282
@SuppressWarnings("resource")
8383
@Bean(initMethod = "start", destroyMethod = "start")
84-
public PostgreSQLContainer<?> container() {
84+
public PostgreSQLContainer container() {
8585

86-
return new PostgreSQLContainer<>("pgvector/pgvector:pg17") //
86+
return new PostgreSQLContainer("pgvector/pgvector:pg17") //
8787
.withUsername("postgres").withReuse(true);
8888
}
8989

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/procedures/MySqlStoredProcedureIntegrationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
import org.springframework.transaction.annotation.EnableTransactionManagement;
4848
import org.springframework.transaction.annotation.Transactional;
4949

50-
import org.testcontainers.containers.MySQLContainer;
50+
import org.testcontainers.mysql.MySQLContainer;
5151

5252
/**
5353
* Testcase to verify {@link org.springframework.jdbc.object.StoredProcedure}s work with MySQL.
@@ -256,9 +256,9 @@ public List<String> getManagedPackages() {
256256

257257
@SuppressWarnings("resource")
258258
@Bean(initMethod = "start", destroyMethod = "stop")
259-
public MySQLContainer<?> container() {
259+
public MySQLContainer container() {
260260

261-
return new MySQLContainer<>("mysql:8.0.24") //
261+
return new MySQLContainer("mysql:8.0.24") //
262262
.withUsername("test") //
263263
.withPassword("test") //
264264
.withConfigurationOverride("");

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/procedures/PostgresStoredProcedureIntegrationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
import org.springframework.transaction.annotation.EnableTransactionManagement;
5353
import org.springframework.transaction.annotation.Transactional;
5454

55-
import org.testcontainers.containers.PostgreSQLContainer;
55+
import org.testcontainers.postgresql.PostgreSQLContainer;
5656

5757
/**
5858
* Testcase to verify {@link org.springframework.jdbc.object.StoredProcedure}s work with Postgres.
@@ -325,9 +325,9 @@ public List<String> getManagedPackages() {
325325

326326
@SuppressWarnings("resource")
327327
@Bean(initMethod = "start", destroyMethod = "stop")
328-
public PostgreSQLContainer<?> container() {
328+
public PostgreSQLContainer container() {
329329

330-
return new PostgreSQLContainer<>("postgres:15.3") //
330+
return new PostgreSQLContainer("postgres:15.3") //
331331
.withUsername("postgres");
332332
}
333333
}

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/procedures/PostgresStoredProcedureNullHandlingIntegrationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
import org.springframework.transaction.annotation.EnableTransactionManagement;
4848
import org.springframework.transaction.annotation.Transactional;
4949

50-
import org.testcontainers.containers.PostgreSQLContainer;
50+
import org.testcontainers.postgresql.PostgreSQLContainer;
5151

5252
/**
5353
* Testcase to verify {@link org.springframework.jdbc.object.StoredProcedure}s properly handle null values.
@@ -162,9 +162,9 @@ public List<String> getManagedPackages() {
162162

163163
@SuppressWarnings("resource")
164164
@Bean(initMethod = "start", destroyMethod = "stop")
165-
public PostgreSQLContainer<?> container() {
165+
public PostgreSQLContainer container() {
166166

167-
return new PostgreSQLContainer<>("postgres:15.3") //
167+
return new PostgreSQLContainer("postgres:15.3") //
168168
.withUsername("postgres");
169169
}
170170
}

0 commit comments

Comments
 (0)