Interface Target
-
- All Implemented Interfaces:
public interface TargetRun Interaction and perform response verification
-
-
Method Summary
Modifier and Type Method Description abstract UnittestInteraction(String consumerName, Interaction interaction, PactSource source, Map<String, Object> context, Boolean pending)Run Interaction and perform response verificationAny exception will be caught by caller and reported as test failure abstract UnitaddResultCallback(BiConsumer<VerificationResult, IProviderVerifier> callback)Add a callback to receive the test interaction result abstract TargetwithStateHandler(Pair<Class<out Object>, Supplier<out Object>> stateHandler)Add an additional state change handler to look for state change callbacks abstract TargetwithStateHandlers(Pair<Class<out Object>, Supplier<out Object>> stateHandlers)Add additional state change handlers to look for state change callbacks abstract UnitsetStateHandlers(List<Pair<Class<out Object>, Supplier<out Object>>> stateHandlers)Add additional state change handlers to look for state change callbacks abstract List<Pair<Class<out Object>, Supplier<out Object>>>getStateHandlers()Additional state change handlers to look for state change callbacks Class<?>getRequestClass()abstract UnitconfigureVerifier(PactSource source, String consumerName, Interaction interaction)abstract BooleanvalidForInteraction(Interaction interaction)If this target can verify the interaction abstract IProviderVerifiergetVerifier()-
-
Method Detail
-
testInteraction
abstract Unit testInteraction(String consumerName, Interaction interaction, PactSource source, Map<String, Object> context, Boolean pending)
Run Interaction and perform response verification
Any exception will be caught by caller and reported as test failure
- Parameters:
consumerName- consumer name that generated the interactioninteraction- interaction to be testedsource- Source of the Pact interactioncontext- Context map for the testpending- if the Pact or Interaction is pending
-
addResultCallback
abstract Unit addResultCallback(BiConsumer<VerificationResult, IProviderVerifier> callback)
Add a callback to receive the test interaction result
-
withStateHandler
abstract Target withStateHandler(Pair<Class<out Object>, Supplier<out Object>> stateHandler)
Add an additional state change handler to look for state change callbacks
-
withStateHandlers
abstract Target withStateHandlers(Pair<Class<out Object>, Supplier<out Object>> stateHandlers)
Add additional state change handlers to look for state change callbacks
-
setStateHandlers
abstract Unit setStateHandlers(List<Pair<Class<out Object>, Supplier<out Object>>> stateHandlers)
Add additional state change handlers to look for state change callbacks
-
getStateHandlers
abstract List<Pair<Class<out Object>, Supplier<out Object>>> getStateHandlers()
Additional state change handlers to look for state change callbacks
-
getRequestClass
Class<?> getRequestClass()
-
configureVerifier
abstract Unit configureVerifier(PactSource source, String consumerName, Interaction interaction)
-
validForInteraction
abstract Boolean validForInteraction(Interaction interaction)
If this target can verify the interaction
-
getVerifier
abstract IProviderVerifier getVerifier()
-
-
-
-