From c4b001b732c8a4127e6a2a99e2fd00fff510f629 Mon Sep 17 00:00:00 2001 From: Mahmoud Ben Hassine Date: Tue, 4 May 2021 12:21:58 +0200 Subject: [PATCH] Remove usage of deprecated APIs from testcontainers --- .../repository/MySQLJdbcJobRepositoryIntegrationTests.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/MySQLJdbcJobRepositoryIntegrationTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/MySQLJdbcJobRepositoryIntegrationTests.java index f4103afd9..a2d25eebb 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/MySQLJdbcJobRepositoryIntegrationTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/MySQLJdbcJobRepositoryIntegrationTests.java @@ -27,6 +27,7 @@ import org.junit.ClassRule; import org.junit.Test; import org.junit.runner.RunWith; import org.testcontainers.containers.MySQLContainer; +import org.testcontainers.utility.DockerImageName; import org.springframework.batch.core.Job; import org.springframework.batch.core.JobExecution; @@ -57,8 +58,12 @@ import org.springframework.test.context.junit4.SpringRunner; @ContextConfiguration public class MySQLJdbcJobRepositoryIntegrationTests { + // TODO find the best way to externalize and manage image versions + // when implementing https://github.com/spring-projects/spring-batch/issues/3092 + private static final DockerImageName MYSQL_IMAGE = DockerImageName.parse("mysql:8.0.24"); + @ClassRule - public static MySQLContainer mysql = new MySQLContainer<>(); + public static MySQLContainer mysql = new MySQLContainer<>(MYSQL_IMAGE); @Autowired private DataSource dataSource;