Package com.xebialabs.xlrelease
Class TestcontainersSupport
java.lang.Object
com.xebialabs.xlrelease.TestcontainersSupport
Manages Testcontainers database lifecycle for integration tests.
A singleton container is started per JVM fork and reused across all integration test classes within that fork. The container is automatically cleaned up when the JVM exits.
Supported databases: postgresql (default), mysql, mysql8, oracle, oracle21, mssql.
Activated by the system property xl.testcontainers.db which is set by the Gradle build
via the -Pdb=<name> flag (defaulting to postgresql).
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidInitializes the Testcontainers database if thexl.testcontainers.dbsystem property is set.
-
Field Details
-
TESTCONTAINERS_DB_PROPERTY
- See Also:
-
-
Constructor Details
-
TestcontainersSupport
public TestcontainersSupport()
-
-
Method Details
-
initialize
public static void initialize()Initializes the Testcontainers database if thexl.testcontainers.dbsystem property is set. This method is idempotent - it only starts the container once per JVM.After the container starts, this method sets the following system properties so that the worker isolation code in
XLReleaseIntegrationTestand the Spring context can connect to the containerized database:xl.database.db-driver-classnamexl.database.db-urlxl.reporting.db-driver-classnamexl.reporting.db-urlxl.database.adminUserxl.database.adminPasswordxl.repository.configuration
-