Class MockProxyServer
java.lang.Object
org.junit.rules.ExternalResource
com.atlassian.crowd.acceptance.utils.proxy.MockProxyServer
- All Implemented Interfaces:
org.junit.rules.TestRule
public class MockProxyServer
extends org.junit.rules.ExternalResource
Creates a proxy server, that allows verifying expected calls and returning expected responses without calling the
remote server. The server is automatically shut down once the test finishes
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
MockProxyServer
(int port, Duration connectionTimeout, Iterable<MockServerResponse> expectedServerResponses) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
after()
protected void
before()
static MockProxyServer.Builder
builder()
static MockProxyServer.Builder
builder
(MockProxyServer data) int
getPort()
org.mockserver.integration.ClientAndServer
Methods inherited from class org.junit.rules.ExternalResource
apply
-
Field Details
-
PROXY_HOST
- See Also:
-
-
Constructor Details
-
MockProxyServer
protected MockProxyServer(int port, Duration connectionTimeout, Iterable<MockServerResponse> expectedServerResponses)
-
-
Method Details
-
getPort
public int getPort() -
getServer
public org.mockserver.integration.ClientAndServer getServer() -
getConnectionTimeout
-
getExpectedServerResponses
-
builder
-
builder
-
before
- Overrides:
before
in classorg.junit.rules.ExternalResource
- Throws:
Throwable
-
after
protected void after()- Overrides:
after
in classorg.junit.rules.ExternalResource
-