Class ProxyRegistry
java.lang.Object
io.camunda.zeebe.qa.util.testcontainers.ProxyRegistry
A utility registry to keep track of proxies that were created for a given
ToxiproxyContainer. Proxies are identified by their upstream target, and cannot be removed from
the registry for now.
NOTE: before proxies can be created, the associated container must be started!
NOTE: this class should be extended based on usage, i.e. as needed.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordWrapper type which keeps track of each proxy and their associated unmapped port. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.testcontainers.containers.ToxiproxyContaineraddExposedPorts(org.testcontainers.containers.ToxiproxyContainer container) getOrCreateHostProxy(int port) Returns the proxy associated with the given port on the local host, or creates a new instance.getOrCreateProxy(String upstream) Returns the proxy associated with the given upstream, or creates a new instance.
-
Constructor Details
-
ProxyRegistry
public ProxyRegistry(org.testcontainers.containers.ToxiproxyContainer toxiproxy)
-
-
Method Details
-
addExposedPorts
public static org.testcontainers.containers.ToxiproxyContainer addExposedPorts(org.testcontainers.containers.ToxiproxyContainer container) -
getOrCreateProxy
Returns the proxy associated with the given upstream, or creates a new instance.- Parameters:
upstream- the upstream endpoint that the proxy points to- Returns:
- a
ProxyRegistry.ContainerProxywhich can be used to access the proxy
-
getOrCreateHostProxy
Returns the proxy associated with the given port on the local host, or creates a new instance.- Parameters:
port- the upstream port that the proxy points to- Returns:
- a
ProxyRegistry.ContainerProxywhich can be used to access the proxy
-