Class DatabaseWrapper

java.lang.Object
liquibase.extension.testing.testsystem.wrapper.DatabaseWrapper
Direct Known Subclasses:
DockerDatabaseWrapper, JdbcDatabaseWrapper, UnimplementedWrapper

public abstract class DatabaseWrapper extends Object
Wraps the external database used by DatabaseTestSystem so that HOW the database is interacted with is independent of WHAT we do with that connection. For example, the same setup logic can be applied regardless of whether the wrapped database is accessed via JdbcDatabaseWrapper or DockerDatabaseWrapper.
  • Constructor Details

    • DatabaseWrapper

      public DatabaseWrapper()
  • Method Details

    • start

      public abstract void start() throws Exception
      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.
      Throws:
      Exception
    • stop

      public abstract void stop() throws Exception
      Stop the database if possible. If the database is managed externally, do not actually stop it.
      Throws:
      Exception
    • getUsername

      public abstract String getUsername()
    • getUrl

      public abstract String getUrl()
    • describe

      public abstract String describe()
      Describes the configuration of this wrapper. Used in outputting to user how this connection is configured.