diff --git a/framework-docs/src/docs/asciidoc/testing/testcontext-framework.adoc b/framework-docs/src/docs/asciidoc/testing/testcontext-framework.adoc index ec8663d652..0fabda612d 100644 --- a/framework-docs/src/docs/asciidoc/testing/testcontext-framework.adoc +++ b/framework-docs/src/docs/asciidoc/testing/testcontext-framework.adoc @@ -2023,8 +2023,7 @@ properties. @Container static GenericContainer redis = - new GenericContainer(DockerImageName.parse("redis:5.0.3-alpine")) - .withExposedPorts(6379); + new GenericContainer("redis:5.0.3-alpine").withExposedPorts(6379); @DynamicPropertySource static void redisProperties(DynamicPropertyRegistry registry) { @@ -2048,8 +2047,7 @@ properties. @Container @JvmStatic val redis: GenericContainer = - GenericContainer(DockerImageName.parse("redis:5.0.3-alpine")) - .withExposedPorts(6379) + GenericContainer("redis:5.0.3-alpine").withExposedPorts(6379) @DynamicPropertySource @JvmStatic diff --git a/spring-test/src/main/java/org/springframework/test/context/DynamicPropertySource.java b/spring-test/src/main/java/org/springframework/test/context/DynamicPropertySource.java index 1ebdc425ff..57732968e7 100644 --- a/spring-test/src/main/java/org/springframework/test/context/DynamicPropertySource.java +++ b/spring-test/src/main/java/org/springframework/test/context/DynamicPropertySource.java @@ -71,8 +71,7 @@ import java.lang.annotation.Target; * * @Container * static GenericContainer redis = - * new GenericContainer(DockerImageName.parse("redis:5.0.3-alpine")) - * .withExposedPorts(6379); + * new GenericContainer("redis:5.0.3-alpine").withExposedPorts(6379); * * // ... *