Package org.testcontainers.containers
Class ToxiproxyContainer
java.lang.Object
org.testcontainers.containers.GenericContainer<ToxiproxyContainer>
org.testcontainers.containers.ToxiproxyContainer
- All Implemented Interfaces:
AutoCloseable,org.testcontainers.containers.Container<ToxiproxyContainer>,org.testcontainers.containers.ContainerState,org.testcontainers.containers.traits.LinkableContainer,org.testcontainers.containers.wait.strategy.WaitStrategyTarget,org.testcontainers.lifecycle.Startable
@Deprecated
public class ToxiproxyContainer
extends org.testcontainers.containers.GenericContainer<ToxiproxyContainer>
Deprecated.
Testcontainers implementation for Toxiproxy.
Supported images: ghcr.io/shopify/toxiproxy, shopify/toxiproxy
Exposed ports:
- HTTP: 8474
- Proxied Ports: 8666-8697
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.testcontainers.containers.Container
org.testcontainers.containers.Container.ExecResult -
Field Summary
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
ConstructorsConstructorDescriptionDeprecated.useToxiproxyContainer(DockerImageName)insteadToxiproxyContainer(String dockerImageName) Deprecated.ToxiproxyContainer(org.testcontainers.utility.DockerImageName dockerImageName) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcontainerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo) Deprecated.intDeprecated.Deprecated.ToxiproxyContainerwill not build the client.getProxy(org.testcontainers.containers.GenericContainer<?> container, int port) Deprecated.ToxiproxyContainerwill not build the client.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, start, 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 class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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
-
Constructor Details
-
ToxiproxyContainer
Deprecated.useToxiproxyContainer(DockerImageName)instead -
ToxiproxyContainer
Deprecated. -
ToxiproxyContainer
public ToxiproxyContainer(org.testcontainers.utility.DockerImageName dockerImageName) Deprecated.
-
-
Method Details
-
containerIsStarted
protected void containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo) Deprecated.- Overrides:
containerIsStartedin classorg.testcontainers.containers.GenericContainer<ToxiproxyContainer>
-
getControlPort
public int getControlPort()Deprecated.- Returns:
- Publicly exposed Toxiproxy HTTP API control port.
-
getProxy
@Deprecated public ToxiproxyContainer.ContainerProxy getProxy(org.testcontainers.containers.GenericContainer<?> container, int port) Deprecated.ToxiproxyContainerwill not build the client. Proxies should be provided manually.Obtain aToxiproxyContainer.ContainerProxyinstance for target container that is managed by Testcontainers. The target container should be routable from thisToxiproxyContainerinstance (e.g. on the same DockerNetwork).- Parameters:
container- target containerport- port number on the target service that should be proxied- Returns:
- a
ToxiproxyContainer.ContainerProxyinstance
-
getProxy
Deprecated.ToxiproxyContainerwill not build the client. Proxies should be provided manually.Obtain aToxiproxyContainer.ContainerProxyinstance for a specific hostname and port, which can be for any host that is routable from thisToxiproxyContainerinstance (e.g. on the same DockerNetworkor 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.- Parameters:
hostname- hostname of target server to be proxiedport- port number on the target server that should be proxied- Returns:
- a
ToxiproxyContainer.ContainerProxyinstance
-
ToxiproxyContainerinstead.