public class BaseMockServer implements MockServer
Modifier and Type | Class and Description |
---|---|
static class |
BaseMockServer.Companion |
Modifier and Type | Field and Description |
---|---|
static BaseMockServer.Companion |
Companion |
Constructor and Description |
---|
BaseMockServer(au.com.dius.pact.model.RequestResponsePact pact,
au.com.dius.pact.model.MockProviderConfig config,
com.sun.net.httpserver.HttpServer server,
boolean stopped) |
Modifier and Type | Method and Description |
---|---|
au.com.dius.pact.model.MockProviderConfig |
getConfig() |
au.com.dius.pact.model.RequestResponsePact |
getPact() |
int |
getPort()
Returns the port of the mock server. This will be the port the server is bound to.
|
java.lang.String |
getUrl()
Returns the URL for this mock server. The port will be the one bound by the server.
|
void |
handle(com.sun.net.httpserver.HttpExchange exchange) |
PactVerificationResult |
runAndWritePact(au.com.dius.pact.model.RequestResponsePact pact,
au.com.dius.pact.model.PactSpecVersion pactVersion,
PactTestRun testFn)
This will start the mock server and execute the test function. Returns the result of running the test.
|
void |
start() |
void |
stop() |
PactVerificationResult |
validateMockServerState()
Returns the results of validating the mock server state
|
void |
waitForServer() |
getPort, getUrl, runAndWritePact, validateMockServerState
public static BaseMockServer.Companion Companion
public BaseMockServer(au.com.dius.pact.model.RequestResponsePact pact, au.com.dius.pact.model.MockProviderConfig config, com.sun.net.httpserver.HttpServer server, boolean stopped)
public void handle(com.sun.net.httpserver.HttpExchange exchange)
public void start()
public void stop()
public PactVerificationResult runAndWritePact(au.com.dius.pact.model.RequestResponsePact pact, au.com.dius.pact.model.PactSpecVersion pactVersion, PactTestRun testFn)
This will start the mock server and execute the test function. Returns the result of running the test.
public PactVerificationResult validateMockServerState()
Returns the results of validating the mock server state
public void waitForServer()
public java.lang.String getUrl()
Returns the URL for this mock server. The port will be the one bound by the server.
public int getPort()
Returns the port of the mock server. This will be the port the server is bound to.
public au.com.dius.pact.model.RequestResponsePact getPact()
public au.com.dius.pact.model.MockProviderConfig getConfig()