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.
use ToxiproxyContainer instead.
Testcontainers implementation for Toxiproxy.

Supported images: ghcr.io/shopify/toxiproxy, shopify/toxiproxy

Exposed ports:

  • HTTP: 8474
  • Proxied Ports: 8666-8697
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Deprecated.

    Nested 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, waitStrategy

    Fields inherited from interface org.testcontainers.containers.ContainerState

    STATE_HEALTHY
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    protected void
    containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo)
    Deprecated.
     
    int
    Deprecated.
     
    getProxy(String hostname, int port)
    Deprecated.
    ToxiproxyContainer will not build the client.
    getProxy(org.testcontainers.containers.GenericContainer<?> container, int port)
    Deprecated.
    ToxiproxyContainer will 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, 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.lifecycle.Startable

    close
  • Constructor Details

    • ToxiproxyContainer

      @Deprecated public ToxiproxyContainer()
      Deprecated.
    • ToxiproxyContainer

      public ToxiproxyContainer(String dockerImageName)
      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:
      containerIsStarted in class org.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.
      ToxiproxyContainer will not build the client. Proxies should be provided manually.
      Obtain a ToxiproxyContainer.ContainerProxy instance for target container that is managed by Testcontainers. The target container should be routable from this ToxiproxyContainer instance (e.g. on the same Docker Network).
      Parameters:
      container - target container
      port - port number on the target service that should be proxied
      Returns:
      a ToxiproxyContainer.ContainerProxy instance
    • getProxy

      @Deprecated public ToxiproxyContainer.ContainerProxy getProxy(String hostname, int port)
      Deprecated.
      ToxiproxyContainer will not build the client. Proxies should be provided manually.
      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. 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.

      Parameters:
      hostname - hostname of target server to be proxied
      port - port number on the target server that should be proxied
      Returns:
      a ToxiproxyContainer.ContainerProxy instance