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