From 79c51f7c66285e9b1b5687747c17c96443802cc5 Mon Sep 17 00:00:00 2001 From: "maarten.vercruysse" Date: Wed, 10 Jul 2024 21:41:07 +0200 Subject: [PATCH] Clarify reuse property setting --- .../testcontainers/utility/TestcontainersConfiguration.java | 1 - docs/features/reuse.md | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java b/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java index 921e36f80cd..e67a0b83ee2 100644 --- a/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java +++ b/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java @@ -181,7 +181,6 @@ public boolean isDisableChecks() { @UnstableAPI public boolean environmentSupportsReuse() { - // specifically not supported as an environment variable or classpath property return Boolean.parseBoolean(getEnvVarOrUserProperty("testcontainers.reuse.enable", "false")); } diff --git a/docs/features/reuse.md b/docs/features/reuse.md index b36669876c2..f7d8062138c 100644 --- a/docs/features/reuse.md +++ b/docs/features/reuse.md @@ -16,7 +16,11 @@ opt-in mechanism per environment. To reuse a container, the container configurat ## How to use it -* Enable `Reusable Containers` in `~/.testcontainers.properties`, by adding `testcontainers.reuse.enable=true` +* Enable `Reusable Containers` + * through environment variable `TESTCONTAINERS_REUSE_ENABLE=true` + * through user property file `~/.testcontainers.properties`, by adding `testcontainers.reuse.enable=true` + * **not** through classpath properties file [see this comment](https://github.com/testcontainers/testcontainers-java/issues/5364#issuecomment-1125907734) + * Define a container and subscribe to reuse the container using `withReuse(true)` ```java