Class DockerDatabaseWrapper
java.lang.Object
liquibase.extension.testing.testsystem.wrapper.DatabaseWrapper
liquibase.extension.testing.testsystem.wrapper.DockerDatabaseWrapper
Implementation of
DatabaseWrapper
for databases that are managed via docker in JdbcDatabaseContainer
s.-
Field Summary
-
Constructor Summary
ConstructorDescriptionDockerDatabaseWrapper
(org.testcontainers.containers.JdbcDatabaseContainer container, TestSystem testSystem) -
Method Summary
Modifier and TypeMethodDescriptiondescribe()
Describes the configuration of this wrapper.org.testcontainers.containers.JdbcDatabaseContainer
getUrl()
protected void
mapPorts
(org.testcontainers.containers.JdbcDatabaseContainer container) protected Runnable
If the container requires the user accepting a license, return a Runnable which will accept it.void
start()
Start the database if possible and ensure it can be connected to.void
stop()
Stop the database if possible.
-
Field Details
-
TEST_SYSTEM_LABEL
- See Also:
-
-
Constructor Details
-
DockerDatabaseWrapper
public DockerDatabaseWrapper(org.testcontainers.containers.JdbcDatabaseContainer container, TestSystem testSystem)
-
-
Method Details
-
describe
Description copied from class:DatabaseWrapper
Describes the configuration of this wrapper. Used in outputting to user how this connection is configured.- Specified by:
describe
in classDatabaseWrapper
-
start
Description copied from class:DatabaseWrapper
Start the database if possible and ensure it can be connected to. If the database is managed externally, just ensure it can be connected to.- Specified by:
start
in classDatabaseWrapper
- Throws:
Exception
-
requireLicense
If the container requires the user accepting a license, return a Runnable which will accept it.- Returns:
- a non-null value if
start()
should call the Runnable if the user accepted the license.
-
mapPorts
protected void mapPorts(org.testcontainers.containers.JdbcDatabaseContainer container) -
stop
Description copied from class:DatabaseWrapper
Stop the database if possible. If the database is managed externally, do not actually stop it.- Specified by:
stop
in classDatabaseWrapper
- Throws:
Exception
-
getUrl
- Specified by:
getUrl
in classDatabaseWrapper
-
getContainer
public org.testcontainers.containers.JdbcDatabaseContainer getContainer() -
getUsername
- Specified by:
getUsername
in classDatabaseWrapper
-