public class ToxiproxyContainer extends org.testcontainers.containers.GenericContainer<ToxiproxyContainer>
| Modifier and Type | Class and Description |
|---|---|
static class |
ToxiproxyContainer.ContainerProxy |
| Constructor and Description |
|---|
ToxiproxyContainer()
Deprecated.
use
ToxiproxyContainer(DockerImageName) instead |
ToxiproxyContainer(org.testcontainers.utility.DockerImageName dockerImageName) |
ToxiproxyContainer(java.lang.String dockerImageName) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo) |
int |
getControlPort() |
ToxiproxyContainer.ContainerProxy |
getProxy(org.testcontainers.containers.GenericContainer<?> container,
int port)
Obtain a
ToxiproxyContainer.ContainerProxy instance for target container that is managed by Testcontainers. |
ToxiproxyContainer.ContainerProxy |
getProxy(java.lang.String hostname,
int port)
Obtain a
ToxiproxyContainer.ContainerProxy instance for a specific hostname and port, which can be for any host
that is routable from this ToxiproxyContainer instance (e.g. |
addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, apply, canBeReused, configure, containerIsCreated, containerIsStarted, containerIsStarting, containerIsStarting, containerIsStopped, containerIsStopping, copyFileFromContainer, createVolumeDirectory, dependsOn, dependsOn, dependsOn, doStart, equals, failed, finished, 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, setCopyToFileContainerPathMap, setDockerImageName, setEnv, setExposedPorts, setExtraHosts, setHostAccessible, setImage, setLabels, setLinkedContainers, setLogConsumers, setNetwork, setNetworkAliases, setNetworkMode, setPortBindings, setPrivilegedMode, setShmSize, setStartupAttempts, setStartupCheckStrategy, setTmpFsMapping, setVolumesFroms, setWaitStrategy, setWorkingDirectory, start, starting, stop, succeeded, 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, withWorkingDirectoryclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddFileSystemBind, followOutput, followOutput, self, withEnv, withFileSystemBindcopyFileFromContainer, copyFileToContainer, copyFileToContainer, execInContainer, execInContainer, getBoundPortNumbers, getContainerIpAddress, getCurrentContainerInfo, getFirstMappedPort, getHost, getLogs, getLogs, getMappedPort, isCreated, isHealthy, isRunning@Deprecated public ToxiproxyContainer()
ToxiproxyContainer(DockerImageName) insteadpublic ToxiproxyContainer(java.lang.String dockerImageName)
public ToxiproxyContainer(org.testcontainers.utility.DockerImageName dockerImageName)
protected void containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo)
containerIsStarted in class org.testcontainers.containers.GenericContainer<ToxiproxyContainer>public int getControlPort()
public ToxiproxyContainer.ContainerProxy getProxy(org.testcontainers.containers.GenericContainer<?> container, int port)
ToxiproxyContainer.ContainerProxy instance for target container that is managed by Testcontainers. The target
container should be routable from this from this ToxiproxyContainer instance (e.g. on the same
Docker Network).container - target containerport - port number on the target service that should be proxiedToxiproxyContainer.ContainerProxy instancepublic ToxiproxyContainer.ContainerProxy getProxy(java.lang.String hostname, int port)
ToxiproxyContainer.ContainerProxy instance for a specific hostname and port, which can be for any host
that is routable from this ToxiproxyContainer instance (e.g. on the same
Docker Network or on routable from the Docker host).
It is expected that getProxy(GenericContainer, int) will be more
useful in most scenarios, but this method is present to allow use of Toxiproxy in front of containers
or external servers that are not managed by Testcontainers.
hostname - hostname of target server to be proxiedport - port number on the target server that should be proxiedToxiproxyContainer.ContainerProxy instance