Interface TestTarget

  • All Implemented Interfaces:

    
    public interface TestTarget
    
                        

    Interface to a test target

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract IProviderInfo getProviderInfo(String serviceName, PactSource pactSource) Returns information about the provider
      abstract Pair<Object, Object> prepareRequest(Pact pact, Interaction interaction, Map<String, Object> context) Prepares the request for the interaction.
      abstract Boolean isHttpTarget() If this is a request response (HTTP or HTTPS) target
      abstract ProviderResponse executeInteraction(Object client, Object request) Executes the test (using the client and request from prepareRequest, if any)
      abstract Unit prepareVerifier(IProviderVerifier verifier, Object testInstance, Pact pact) Prepares the verifier for use during the test
      Boolean supportsInteraction(Interaction interaction) If the test target supports the given interaction
      abstract Map<String, Object> getUserConfig() Any user provided configuration
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • getProviderInfo

         abstract IProviderInfo getProviderInfo(String serviceName, PactSource pactSource)

        Returns information about the provider

      • prepareRequest

         abstract 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

         abstract Boolean isHttpTarget()

        If this is a request response (HTTP or HTTPS) target

      • executeInteraction

         abstract 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

         abstract Unit prepareVerifier(IProviderVerifier verifier, Object testInstance, Pact pact)

        Prepares the verifier for use during the test