Class OrdsContainer
java.lang.Object
org.testcontainers.containers.GenericContainer<OrdsContainer>
com.oracle.spring.testcontainers.OrdsContainer
- All Implemented Interfaces:
AutoCloseable, org.testcontainers.containers.Container<OrdsContainer>, org.testcontainers.containers.ContainerState, org.testcontainers.containers.traits.LinkableContainer, org.testcontainers.containers.wait.strategy.WaitStrategyTarget, org.testcontainers.lifecycle.Startable
Testcontainers implementation for Oracle REST Data Services (ORDS).
The container requires an Oracle AI Database connection string and
administrator password. Schemas registered with withSchema(String, String, String) are REST-enabled after ORDS starts.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.testcontainers.containers.Container
org.testcontainers.containers.Container.ExecResult -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringOfficial ORDS container image.static final intORDS HTTP port.static final intORDS HTTPS port.static final intORDS MongoDB API port.Fields inherited from class org.testcontainers.containers.GenericContainer
CONTAINER_RUNNING_TIMEOUT_SEC, dependencies, dockerClient, INTERNAL_HOST_HOSTNAME, waitStrategyFields inherited from interface org.testcontainers.containers.ContainerState
STATE_HEALTHY -
Constructor Summary
ConstructorsConstructorDescriptionCreates a container using the official ORDS image.OrdsContainer(String dockerImageName) Creates a container using an image name.OrdsContainer(org.testcontainers.utility.DockerImageName dockerImageName) Creates a container using a parsed image name. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcontainerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo) Returns the mapped ORDS HTTP URL.intReturns the mapped ORDS HTTP port.intReturns the mapped ORDS HTTPS port.intReturns the mapped ORDS MongoDB API port.voidstart()withDatabaseConnectionString(String connectionString) Configures the JDBC connection string ORDS uses to install and connect.withOraclePassword(String oraclePassword) Configures the Oracle AI Database administrator password used by ORDS.withSchema(String username, String password, String connectDescriptor) Registers a database schema to enable after ORDS starts.Methods inherited from class org.testcontainers.containers.GenericContainer
addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, canBeReused, configure, 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, getLivenessCheckPortNumbers, 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, stop, toString, waitingFor, waitUntilContainerStarted, 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, withWorkingDirectoryMethods inherited from interface org.testcontainers.containers.Container
addFileSystemBind, followOutput, followOutput, self, withEnv, withFileSystemBindMethods 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, isRunningMethods inherited from interface org.testcontainers.lifecycle.Startable
close
-
Field Details
-
DEFAULT_IMAGE
-
HTTP_PORT
public static final int HTTP_PORTORDS HTTP port.- See Also:
-
HTTPS_PORT
public static final int HTTPS_PORTORDS HTTPS port.- See Also:
-
MONGODB_API_PORT
public static final int MONGODB_API_PORTORDS MongoDB API port.- See Also:
-
-
Constructor Details
-
OrdsContainer
public OrdsContainer()Creates a container using the official ORDS image. -
OrdsContainer
Creates a container using an image name.- Parameters:
dockerImageName- ORDS image name
-
OrdsContainer
public OrdsContainer(org.testcontainers.utility.DockerImageName dockerImageName) Creates a container using a parsed image name.- Parameters:
dockerImageName- ORDS image name
-
-
Method Details
-
withDatabaseConnectionString
Configures the JDBC connection string ORDS uses to install and connect.- Parameters:
connectionString- JDBC connection string reachable from the ORDS container- Returns:
- this container
-
withOraclePassword
Configures the Oracle AI Database administrator password used by ORDS.- Parameters:
oraclePassword- administrator password- Returns:
- this container
-
withSchema
Registers a database schema to enable after ORDS starts.- Parameters:
username- schema usernamepassword- schema passwordconnectDescriptor- database connection descriptor reachable from the ORDS container- Returns:
- this container
-
getBaseUrl
-
getHttpPort
public int getHttpPort()Returns the mapped ORDS HTTP port.- Returns:
- HTTP port
-
getHttpsPort
public int getHttpsPort()Returns the mapped ORDS HTTPS port.- Returns:
- HTTPS port
-
getMongoDbApiPort
public int getMongoDbApiPort()Returns the mapped ORDS MongoDB API port.- Returns:
- MongoDB API port
-
start
public void start()- Specified by:
startin interfaceorg.testcontainers.lifecycle.Startable- Overrides:
startin classorg.testcontainers.containers.GenericContainer<OrdsContainer>
-
containerIsStarted
protected void containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo) - Overrides:
containerIsStartedin classorg.testcontainers.containers.GenericContainer<OrdsContainer>
-