Skip to content

Commit 32d3a2f

Browse files
committed
GH-1352: Support Image Cache for TestContainers
1 parent 3277c89 commit 32d3a2f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Diff for: spring-rabbit-stream/src/test/java/org/springframework/rabbit/stream/listener/AbstractIntegrationTests.java

+9-4
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,17 @@
2828
*/
2929
public abstract class AbstractIntegrationTests {
3030

31-
static final GenericContainer<?> RABBITMQ = new GenericContainer<>(
32-
DockerImageName.parse("pivotalrabbitmq/rabbitmq-stream"))
33-
.withExposedPorts(5672, 15672, 5552)
34-
.withStartupTimeout(Duration.ofMinutes(2));
31+
static final GenericContainer<?> RABBITMQ;
3532

3633
static {
34+
String image = "pivotalrabbitmq/rabbitmq-stream";
35+
String cache = System.getenv().get("IMAGE_CACHE");
36+
if (cache != null) {
37+
image = cache + image;
38+
}
39+
RABBITMQ = new GenericContainer<>(DockerImageName.parse(image))
40+
.withExposedPorts(5672, 15672, 5552)
41+
.withStartupTimeout(Duration.ofMinutes(2));
3742
RABBITMQ.start();
3843
}
3944

0 commit comments

Comments
 (0)