Search in sources :

Example 6 with ProviderInfo

use of au.com.dius.pact.provider.ProviderInfo in project pact-jvm by DiUS.

the class AmqpTarget method testInteraction.

/**
     * {@inheritDoc}
     */
@Override
public void testInteraction(final String consumerName, final Interaction interaction) {
    ProviderInfo provider = getProviderInfo();
    ConsumerInfo consumer = new ConsumerInfo(consumerName);
    ProviderVerifier verifier = setupVerifier(interaction, provider, consumer);
    Map<String, Object> failures = new HashMap<>();
    verifier.verifyResponseByInvokingProviderMethods(provider, consumer, interaction, interaction.getDescription(), failures);
    try {
        if (!failures.isEmpty()) {
            verifier.displayFailures(failures);
            throw getAssertionError(failures);
        }
    } finally {
        verifier.finialiseReports();
    }
}
Also used : ConsumerInfo(au.com.dius.pact.provider.ConsumerInfo) ProviderInfo(au.com.dius.pact.provider.ProviderInfo) HashMap(java.util.HashMap) ProviderVerifier(au.com.dius.pact.provider.ProviderVerifier)

Aggregations

ConsumerInfo (au.com.dius.pact.provider.ConsumerInfo)6 ProviderInfo (au.com.dius.pact.provider.ProviderInfo)6 ProviderVerifier (au.com.dius.pact.provider.ProviderVerifier)5 HashMap (java.util.HashMap)4 Interaction (au.com.dius.pact.model.Interaction)3 Provider (au.com.dius.pact.provider.junit.Provider)3 URL (java.net.URL)3 PactVerification (au.com.dius.pact.provider.PactVerification)2 TargetRequestFilter (au.com.dius.pact.provider.junit.TargetRequestFilter)2 MvcProviderVerifier (au.com.dius.pact.provider.spring.MvcProviderVerifier)2 URLClassLoader (java.net.URLClassLoader)2 List (java.util.List)2 Map (java.util.Map)2 Consumer (java.util.function.Consumer)2 HttpRequest (org.apache.http.HttpRequest)2 MethodClosure (org.codehaus.groovy.runtime.MethodClosure)2 FrameworkMethod (org.junit.runners.model.FrameworkMethod)2 MockMvc (org.springframework.test.web.servlet.MockMvc)2 Pact (au.com.dius.pact.model.Pact)1 RequestResponseInteraction (au.com.dius.pact.model.RequestResponseInteraction)1