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
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMockProxyServer(int port, Duration connectionTimeout, Iterable<MockServerResponse> expectedServerResponses) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafter()protected voidbefore()static MockProxyServer.Builderbuilder()static MockProxyServer.Builderbuilder(MockProxyServer data) intgetPort()org.mockserver.integration.ClientAndServerMethods 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:
beforein classorg.junit.rules.ExternalResource- Throws:
Throwable
-
after
protected void after()- Overrides:
afterin classorg.junit.rules.ExternalResource
-