Skip to content

Commit 5a42d71

Browse files
committed
Deprecate TestUtils.dockerRegistryFromEnv()
The Testcontainers rely on the `TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX` ENV var and build proper image name automatically. * Deprecate `TestUtils.dockerRegistryFromEnv()` and remove its usage in the project
1 parent a614e4b commit 5a42d71

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/mysql/MySqlContainerTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
import org.junit.jupiter.api.BeforeAll;
2020
import org.testcontainers.containers.MySQLContainer;
2121
import org.testcontainers.junit.jupiter.Testcontainers;
22-
import org.testcontainers.utility.DockerImageName;
23-
24-
import org.springframework.integration.test.util.TestUtils;
2522

2623
/**
2724
* The base contract for JUnit tests based on the container for MqSQL.

spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/MosquittoContainerTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import org.testcontainers.containers.GenericContainer;
2121
import org.testcontainers.junit.jupiter.Testcontainers;
2222

23-
import org.springframework.integration.test.util.TestUtils;
24-
2523
/**
2624
* The base contract for JUnit tests based on the container for MQTT Mosquitto broker.
2725
* The Testcontainers 'reuse' option must be disabled,so, Ryuk container is started
@@ -37,7 +35,7 @@
3735
public interface MosquittoContainerTest {
3836

3937
GenericContainer<?> MOSQUITTO_CONTAINER =
40-
new GenericContainer<>(TestUtils.dockerRegistryFromEnv() + "eclipse-mosquitto:2.0.12")
38+
new GenericContainer<>("eclipse-mosquitto:2.0.12")
4139
.withCommand("mosquitto -c /mosquitto-no-auth.conf")
4240
.withExposedPorts(1883);
4341

spring-integration-test-support/src/main/java/org/springframework/integration/test/util/TestUtils.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,12 @@ public static void revertLogLevels(String methodName, LevelsContainer container)
375375
ctx.updateLoggers();
376376
}
377377

378+
/**
379+
* Take a Docker Hub url from ENV var.
380+
* @return a Docker Hub url from ENV var.
381+
* @deprecated since 5.5.13 in favor of standard {@code TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX} ENV var
382+
*/
383+
@Deprecated
378384
public static String dockerRegistryFromEnv() {
379385
return Optional.ofNullable(System.getenv("DOCKER_REGISTRY_URL")).orElse("");
380386
}

0 commit comments

Comments
 (0)