Class OperatonMSSQLContainer

java.lang.Object
org.testcontainers.containers.GenericContainer<SELF>
org.testcontainers.containers.JdbcDatabaseContainer<org.testcontainers.mssqlserver.MSSQLServerContainer>
org.testcontainers.mssqlserver.MSSQLServerContainer
org.operaton.impl.test.utils.testcontainers.OperatonMSSQLContainer
All Implemented Interfaces:
AutoCloseable, org.testcontainers.containers.Container<org.testcontainers.mssqlserver.MSSQLServerContainer>, org.testcontainers.containers.ContainerState, org.testcontainers.containers.traits.LinkableContainer, org.testcontainers.containers.wait.strategy.WaitStrategyTarget, org.testcontainers.lifecycle.Startable

public class OperatonMSSQLContainer extends org.testcontainers.mssqlserver.MSSQLServerContainer
Class for setting up a MSSQLServer database and managing its lifecycle within the test environment. This class is a custom extension of Testcontainers' MSSQLServerContainer , providing additional functionality for the Operaton project.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.testcontainers.containers.JdbcDatabaseContainer

    org.testcontainers.containers.JdbcDatabaseContainer.NoDriverFoundException

    Nested classes/interfaces inherited from interface org.testcontainers.containers.Container

    org.testcontainers.containers.Container.ExecResult
  • Field Summary

    Fields inherited from class org.testcontainers.mssqlserver.MSSQLServerContainer

    IMAGE, MS_SQL_SERVER_PORT, NAME

    Fields inherited from class org.testcontainers.containers.JdbcDatabaseContainer

    parameters, urlParameters

    Fields inherited from class org.testcontainers.containers.GenericContainer

    CONTAINER_RUNNING_TIMEOUT_SEC, dependencies, dockerClient, INTERNAL_HOST_HOSTNAME, waitStrategy

    Fields inherited from interface org.testcontainers.containers.ContainerState

    STATE_HEALTHY
  • Constructor Summary

    Constructors
    Constructor
    Description
    OperatonMSSQLContainer(String dockerImageName)
     
    OperatonMSSQLContainer(org.testcontainers.utility.DockerImageName dockerImageName)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerResponse)
    Hook to set up a database with correct transaction isolation after starting the container.

    Methods inherited from class org.testcontainers.mssqlserver.MSSQLServerContainer

    acceptLicense, configure, constructUrlForConnection, getDriverClassName, getJdbcUrl, getLivenessCheckPortNumbers, getPassword, getTestQueryString, getUsername, withPassword

    Methods inherited from class org.testcontainers.containers.JdbcDatabaseContainer

    addParameter, constructUrlParameters, constructUrlParameters, createConnection, createConnection, getConnectTimeoutSeconds, getDatabaseDelegate, getDatabaseName, getJdbcDriverInstance, getStartupTimeoutSeconds, optionallyMapResourceParameterAsVolume, optionallyMapResourceParameterAsVolume, runInitScriptIfRequired, setParameters, waitUntilContainerStarted, withConnectTimeoutSeconds, withDatabaseName, withInitScript, withInitScripts, withInitScripts, withStartupTimeoutSeconds, withUrlParam, withUsername

    Methods inherited from class org.testcontainers.containers.GenericContainer

    addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, canBeReused, containerIsCreated, containerIsStarted, containerIsStarting, containerIsStarting, containerIsStopped, containerIsStopping, copyFileFromContainer, createVolumeDirectory, dependsOn, dependsOn, dependsOn, doStart, equals, getBinds, getCommandParts, getContainerId, getContainerInfo, getContainerName, getCopyToFileContainerPathMap, getCreateContainerCmdModifiers, getDependencies, getDockerClient, getDockerImageName, getEnv, getEnvMap, getExposedPorts, getExtraHosts, getImage, getIpAddress, getLabels, getLinkedContainers, getLivenessCheckPort, getLivenessCheckPorts, getLogConsumers, getNetwork, getNetworkAliases, getNetworkMode, getPortBindings, getShmSize, getStartupAttempts, getStartupCheckStrategy, getTestHostIpAddress, getTmpFsMapping, getVolumesFroms, getWaitStrategy, getWorkingDirectory, hashCode, isHostAccessible, isPrivilegedMode, isShouldBeReused, logger, setBinds, setCommand, setCommand, setCommandParts, setContainerDef, setCopyToFileContainerPathMap, setDockerImageName, setEnv, setExposedPorts, setExtraHosts, setHostAccessible, setImage, setLabels, setLinkedContainers, setLogConsumers, setNetwork, setNetworkAliases, setNetworkMode, setPortBindings, setPrivilegedMode, setShmSize, setStartupAttempts, setStartupCheckStrategy, setTmpFsMapping, setVolumesFroms, setWaitStrategy, setWorkingDirectory, start, stop, toString, waitingFor, withAccessToHost, withClasspathResourceMapping, withClasspathResourceMapping, withCommand, withCommand, withCopyFileToContainer, withCopyToContainer, withCreateContainerCmdModifier, withEnv, withEnv, withExposedPorts, withExtraHost, withFileSystemBind, withImagePullPolicy, withLabel, withLabels, withLogConsumer, withMinimumRunningDuration, withNetwork, withNetworkAliases, withNetworkMode, withPrivilegedMode, withReuse, withSharedMemorySize, withStartupAttempts, withStartupCheckStrategy, withStartupTimeout, withTmpFs, withVolumesFrom, withWorkingDirectory

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.testcontainers.containers.Container

    addFileSystemBind, followOutput, followOutput, self, withEnv, withFileSystemBind

    Methods inherited from interface org.testcontainers.containers.ContainerState

    copyFileFromContainer, copyFileToContainer, copyFileToContainer, execInContainer, execInContainer, execInContainer, execInContainer, execInContainerWithUser, execInContainerWithUser, getBoundPortNumbers, getContainerIpAddress, getCurrentContainerInfo, getFirstMappedPort, getHost, getLogs, getLogs, getMappedPort, isCreated, isHealthy, isRunning

    Methods inherited from interface org.testcontainers.containers.traits.LinkableContainer

    getContainerName

    Methods inherited from interface org.testcontainers.lifecycle.Startable

    close
  • Constructor Details

    • OperatonMSSQLContainer

      public OperatonMSSQLContainer(org.testcontainers.utility.DockerImageName dockerImageName)
    • OperatonMSSQLContainer

      public OperatonMSSQLContainer(String dockerImageName)
  • Method Details

    • containerIsStarted

      protected void containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerResponse)
      Hook to set up a database with correct transaction isolation after starting the container. We override the parent's database creation to ensure READ_COMMITTED_SNAPSHOT is enabled. Necessary, because the master DB of SQL server has some constraints and cannot be configured to enable READ_COMMITTED_SNAPSHOT.
      Overrides:
      containerIsStarted in class org.testcontainers.containers.JdbcDatabaseContainer<org.testcontainers.mssqlserver.MSSQLServerContainer>
      Parameters:
      containerResponse - Metadata of the started container