Class TestContainerHandler

java.lang.Object
io.helidon.data.sql.testing.TestContainerHandler

public class TestContainerHandler extends Object
This is an internal object needed to reconfigure the environment once a container is started.
  • Method Details

    • startContainer

      public int startContainer()
      Start the container, and return the mapped port.
      Returns:
      container port that was originally configured in the URI, which must be the default port of that database
    • setConfig

      public Config setConfig()
      Set the new configuration with mapped port. Uses the original configuration that was used to configure the container.
      Returns:
      the new config instance
    • config

      public Config config()
      Get the current correct config. If the container is started, the config will contain updated port for the database URL.
      Returns:
      updated config
    • originalPort

      public int originalPort()
      The port as configured in the database URL before the container is started. This must be the default port of the database that is used, as it is used to obtain the mapped port.
      Returns:
      original DB port
    • stopContainer

      public void stopContainer()
      Stop the container.