Package au.com.dius.pact.provider.junit5
Class PluginTestTarget
-
- All Implemented Interfaces:
-
au.com.dius.pact.provider.junit5.TestTarget
public final class PluginTestTarget implements TestTarget
Test target were the verification will be provided by a plugin
-
-
Field Summary
Fields Modifier and Type Field Description private final Map<String, Object>userConfig
-
Constructor Summary
Constructors Constructor Description PluginTestTarget(Map<String, Object> config)
-
Method Summary
Modifier and Type Method Description Map<String, Object>getUserConfig()Any user provided configuration IProviderInfogetProviderInfo(String serviceName, PactSource pactSource)Returns information about the provider Pair<Object, Object>prepareRequest(Pact pact, Interaction interaction, Map<String, Object> context)Prepares the request for the interaction. BooleanisHttpTarget()If this is a request response (HTTP or HTTPS) target BooleansupportsInteraction(Interaction interaction)If the test target supports the given interaction ProviderResponseexecuteInteraction(Object client, Object request)Executes the test (using the client and request from prepareRequest, if any) UnitprepareVerifier(IProviderVerifier verifier, Object testInstance, Pact pact)Prepares the verifier for use during the test -
-
Method Detail
-
getUserConfig
Map<String, Object> getUserConfig()
Any user provided configuration
-
getProviderInfo
IProviderInfo getProviderInfo(String serviceName, PactSource pactSource)
Returns information about the provider
-
prepareRequest
Pair<Object, Object> prepareRequest(Pact pact, Interaction interaction, Map<String, Object> context)
Prepares the request for the interaction.
- Returns:
a pair of the client class and request to use for the test, or null if there is none
-
isHttpTarget
Boolean isHttpTarget()
If this is a request response (HTTP or HTTPS) target
-
supportsInteraction
Boolean supportsInteraction(Interaction interaction)
If the test target supports the given interaction
-
executeInteraction
ProviderResponse executeInteraction(Object client, Object request)
Executes the test (using the client and request from prepareRequest, if any)
- Returns:
Map of failures, or an empty map if there were not any
-
prepareVerifier
Unit prepareVerifier(IProviderVerifier verifier, Object testInstance, Pact pact)
Prepares the verifier for use during the test
-
-
-
-