...
- On start() method invocation the requested test container is created (if absent) within a Docker and started (if not running yet)
- On stop() method invocation the test container is stopped and removed
If annotated as \as @Rule
the test container creation/start then stop/removal operations will be performed for each test method.
If annotated as \as @ClassRule
these operation will be performed for each test class.
...
Drawio | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
NB. The default testcontainer removal by default is served using remaining test containers removal (on JVM termination) was served by dedicated RYUK container (part of TestContainers library). However
this However this container require to bu requires running as privileged one, so it was disabled in order make TestContainers available on Jenkins. It made it
necessary to explicitly invoke test container removal logic on JVM termination event.
Database initialization notes
...