public class HttpTestTarget implements TestTarget
Test target for HTTP tests. This is the default target.
public static au.com.dius.pact.provider.junit5.HttpTestTarget.Companion Companion
@JvmOverloads
public HttpTestTarget(@NotNull
java.lang.String host,
int port,
@NotNull
java.lang.String path,
@NotNull
kotlin.jvm.functions.Function0<? extends au.com.dius.pact.provider.IHttpClientFactory> httpClientFactory)
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.@JvmOverloads
public HttpTestTarget(@NotNull
java.lang.String host,
int port,
@NotNull
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.@JvmOverloads
public HttpTestTarget(@NotNull
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.@JvmOverloads
public HttpTestTarget(@NotNull
java.lang.String host)
Test target for HTTP tests. This is the default target.
host - Host to bind to. Defaults to localhost.@JvmOverloads 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
@NotNull
public au.com.dius.pact.provider.ProviderInfo getProviderInfo(@NotNull
java.lang.String serviceName,
@Nullable
au.com.dius.pact.core.model.PactSource pactSource)
Returns information about the provider
@Nullable
public kotlin.Pair<java.lang.Object,java.lang.Object> prepareRequest(@NotNull
au.com.dius.pact.core.model.Interaction interaction,
@NotNull
java.util.Map<java.lang.String,? extends java.lang.Object> context)
Prepares the request for the interaction.
public void prepareVerifier(@NotNull
au.com.dius.pact.provider.IProviderVerifier verifier,
@NotNull
java.lang.Object testInstance)
Prepares the verifier for use during the test
@NotNull
public au.com.dius.pact.provider.ProviderResponse executeInteraction(@Nullable
java.lang.Object client,
@Nullable
java.lang.Object request)
Executes the test (using the client and request from prepareRequest, if any)
@NotNull 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.
@NotNull public java.lang.String getPath()
The path that the provider is mounted on.
Defaults to the root path.
@NotNull public kotlin.jvm.functions.Function0<au.com.dius.pact.provider.IHttpClientFactory> getHttpClientFactory()
@JvmStatic @NotNull public static HttpTestTarget fromUrl(@NotNull java.net.URL url)
Creates a HttpTestTarget from a URL. If the URL does not contain a port, 8080 will be used.