Class DockerDatabaseWrapper

java.lang.Object
liquibase.extension.testing.testsystem.wrapper.DatabaseWrapper
liquibase.extension.testing.testsystem.wrapper.DockerDatabaseWrapper

public class DockerDatabaseWrapper extends DatabaseWrapper
Implementation of DatabaseWrapper for databases that are managed via docker in JdbcDatabaseContainers.
  • Field Details

  • Constructor Details

    • DockerDatabaseWrapper

      public DockerDatabaseWrapper(org.testcontainers.containers.JdbcDatabaseContainer container, TestSystem testSystem)
  • Method Details

    • describe

      public String 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 class DatabaseWrapper
    • start

      public void start() throws Exception
      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 class DatabaseWrapper
      Throws:
      Exception
    • requireLicense

      protected Runnable 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

      public void stop() throws Exception
      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 class DatabaseWrapper
      Throws:
      Exception
    • getUrl

      public String getUrl()
      Specified by:
      getUrl in class DatabaseWrapper
    • getContainer

      public org.testcontainers.containers.JdbcDatabaseContainer getContainer()
    • getUsername

      public String getUsername()
      Specified by:
      getUsername in class DatabaseWrapper