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 JdbcDatabaseContainers.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDockerDatabaseWrapper(org.testcontainers.containers.JdbcDatabaseContainer container, TestSystem testSystem) -
Method Summary
Modifier and TypeMethodDescriptiondescribe()Describes the configuration of this wrapper.org.testcontainers.containers.JdbcDatabaseContainergetUrl()protected voidmapPorts(org.testcontainers.containers.JdbcDatabaseContainer container) protected RunnableIf the container requires the user accepting a license, return a Runnable which will accept it.voidstart()Start the database if possible and ensure it can be connected to.voidstop()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:DatabaseWrapperDescribes the configuration of this wrapper. Used in outputting to user how this connection is configured.- Specified by:
describein classDatabaseWrapper
-
start
Description copied from class:DatabaseWrapperStart 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:
startin 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:DatabaseWrapperStop the database if possible. If the database is managed externally, do not actually stop it.- Specified by:
stopin classDatabaseWrapper- Throws:
Exception
-
getUrl
- Specified by:
getUrlin classDatabaseWrapper
-
getContainer
public org.testcontainers.containers.JdbcDatabaseContainer getContainer() -
getUsername
- Specified by:
getUsernamein classDatabaseWrapper
-