Tried your workaround solution on your PatchProductLoadITTest and ProductControllerITTest by adding:
testcontainers.reuse.enable=true to .testcontainers.properties
.withReuse(true) to MONGO_DB_CONTAINER
MONGO_DB_CONTAINER.getReplicaSetUrl()+"-my-db-N" to both tests (N=1 for PatchProductLoadITTest and N=2 for ProductControllerITTest)
But a container is not reused. How can I make it work?
Put it simply, my tests stop each MongoDBContainer in @AfterAll methods. I’ve added if (!MONGO_DB_CONTAINER.isShouldBeReused()) statement to stop MongoDBContainer only if we do not use Testcontainers' reusable feature. See this commit for more details. Thanks for you comment.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Tried your workaround solution on your PatchProductLoadITTest and ProductControllerITTest by adding:
Put it simply, my tests stop each
MongoDBContainer
in@AfterAll
methods. I’ve addedif (!MONGO_DB_CONTAINER.isShouldBeReused())
statement to stopMongoDBContainer
only if we do not use Testcontainers' reusable feature. See this commit for more details. Thanks for you comment.