public class HttpTestTarget implements TestTarget
Test target for HTTP tests. This is the default target.
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpTestTarget.Companion |
| Modifier and Type | Field and Description |
|---|---|
static HttpTestTarget.Companion |
Companion |
| Constructor and Description |
|---|
HttpTestTarget(java.lang.String host,
int port,
java.lang.String path)
Test target for HTTP tests. This is the default target.
|
HttpTestTarget(java.lang.String host,
int port)
Test target for HTTP tests. This is the default target.
|
HttpTestTarget(java.lang.String host)
Test target for HTTP tests. This is the default target.
|
HttpTestTarget()
Test target for HTTP tests. This is the default target.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,java.lang.Object> |
executeInteraction(java.lang.Object client,
java.lang.Object request)
Executes the test (using the client and request from prepareRequest, if any)
|
static HttpTestTarget |
fromUrl(java.net.URL url)
Creates a HttpTestTarget from a URL. If the URL does not contain a port, 8080 will be used.
|
java.lang.String |
getHost()
Host to bind to.
|
java.lang.String |
getPath()
The path that the provider is mounted on.
|
int |
getPort()
Port that the provider is running on.
|
au.com.dius.pact.provider.ProviderInfo |
getProviderInfo(java.lang.String serviceName,
au.com.dius.pact.model.PactSource pactSource)
Returns information about the provider
|
boolean |
isHttpTarget()
If this is a request response (HTTP or HTTPS) target
|
kotlin.Pair<java.lang.Object,java.lang.Object> |
prepareRequest(au.com.dius.pact.model.Interaction interaction,
java.util.Map<java.lang.String,? extends java.lang.Object> context)
Prepares the request for the interaction.
|
void |
prepareVerifier(au.com.dius.pact.provider.IProviderVerifier verifier,
java.lang.Object testInstance)
Prepares the verifier for use during the test
|
executeInteraction, getProviderInfo, isHttpTarget, prepareRequest, prepareVerifierpublic static HttpTestTarget.Companion Companion
public HttpTestTarget(java.lang.String host,
int port,
java.lang.String path)
Test target for HTTP tests. This is the default target.
host - Host to bind to. Defaults to localhost.port - Port that the provider is running on. Defaults to 8080.path - The path that the provider is mounted on. Defaults to the root path.public HttpTestTarget(java.lang.String host,
int port)
Test target for HTTP tests. This is the default target.
host - Host to bind to. Defaults to localhost.port - Port that the provider is running on. Defaults to 8080.public HttpTestTarget(java.lang.String host)
Test target for HTTP tests. This is the default target.
host - Host to bind to. Defaults to localhost.public HttpTestTarget()
Test target for HTTP tests. This is the default target.
public boolean isHttpTarget()
If this is a request response (HTTP or HTTPS) target
public au.com.dius.pact.provider.ProviderInfo getProviderInfo(java.lang.String serviceName,
au.com.dius.pact.model.PactSource pactSource)
Returns information about the provider
public kotlin.Pair<java.lang.Object,java.lang.Object> prepareRequest(au.com.dius.pact.model.Interaction interaction,
java.util.Map<java.lang.String,? extends java.lang.Object> context)
Prepares the request for the interaction.
public void prepareVerifier(au.com.dius.pact.provider.IProviderVerifier verifier,
java.lang.Object testInstance)
Prepares the verifier for use during the test
public java.util.Map<java.lang.String,java.lang.Object> executeInteraction(java.lang.Object client,
java.lang.Object request)
Executes the test (using the client and request from prepareRequest, if any)
public java.lang.String getHost()
Host to bind to.
Defaults to localhost.
public int getPort()
Port that the provider is running on.
Defaults to 8080.
public java.lang.String getPath()
The path that the provider is mounted on.
Defaults to the root path.
public static HttpTestTarget fromUrl(java.net.URL url)
Creates a HttpTestTarget from a URL. If the URL does not contain a port, 8080 will be used.