Interface Container<C extends Container<C>>

All Known Implementing Classes:
ClickHouseContainer, CockroachContainer, Db2Container, ElasticContainer, HanaContainer, LocalDynamoDBContainer, Localstack2Container, LocalstackContainer, MariaDBContainer, MySqlContainer, NuoDBContainer, OracleContainer, PostgisContainer, PostgresContainer, RedisContainer, SqlServerContainer, YugabyteContainer

public interface Container<C extends Container<C>>
Commands for starting and stopping a DB container.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the container configuration.
    boolean
    Return true if the container is running.
    int
    Return the port this container is using.
    Start and return the container.
    boolean
    Start the container returning true if successful.
    void
    Start the container or throw a IllegalStateException.
    void
    Stop the container.
    void
    Stop and remove the container .
  • Method Details

    • config

      ContainerConfig config()
      Returns the container configuration.
    • start

      C start()
      Start and return the container.

      Throws an IllegalStateException if the container can not be started.

    • startOrThrow

      void startOrThrow()
      Start the container or throw a IllegalStateException.
    • startMaybe

      boolean startMaybe()
      Start the container returning true if successful.
    • stop

      void stop()
      Stop the container.
    • stopRemove

      void stopRemove()
      Stop and remove the container .
    • isRunning

      boolean isRunning()
      Return true if the container is running.
    • port

      int port()
      Return the port this container is using.

      This is typically useful if the container was started with a random port and, we need to know what that port was.