Search in sources :

Example 6 with MatchingRuleGroup

use of au.com.dius.pact.core.model.matchingrules.MatchingRuleGroup in project pact-jvm by DiUS.

the class MatcherTestUtils method assertResponseMatcherKeysEqualTo.

public static void assertResponseMatcherKeysEqualTo(RequestResponsePact pact, String category, String... matcherKeys) {
    MatchingRules matchingRules = pact.getInteractions().get(0).asSynchronousRequestResponse().getResponse().getMatchingRules();
    Map<String, MatchingRuleGroup> matchers = matchingRules.rulesForCategory(category).getMatchingRules();
    assertEquals(asSet(matcherKeys), new TreeSet<>(matchers.keySet()));
}
Also used : MatchingRuleGroup(au.com.dius.pact.core.model.matchingrules.MatchingRuleGroup) MatchingRules(au.com.dius.pact.core.model.matchingrules.MatchingRules)

Aggregations

MatchingRuleGroup (au.com.dius.pact.core.model.matchingrules.MatchingRuleGroup)6 RequestResponsePact (au.com.dius.pact.core.model.RequestResponsePact)4 MatchingRules (au.com.dius.pact.core.model.matchingrules.MatchingRules)4 DslPart (au.com.dius.pact.consumer.dsl.DslPart)3 Pact (au.com.dius.pact.core.model.annotations.Pact)3 RegexMatcher (au.com.dius.pact.core.model.matchingrules.RegexMatcher)3 PactDslJsonArray (au.com.dius.pact.consumer.dsl.PactDslJsonArray)2 HashMap (java.util.HashMap)2 PactDslJsonBody (au.com.dius.pact.consumer.dsl.PactDslJsonBody)1 PactDslRootValue (au.com.dius.pact.consumer.dsl.PactDslRootValue)1 PactDslWithProvider (au.com.dius.pact.consumer.dsl.PactDslWithProvider)1 MatchingRule (au.com.dius.pact.core.model.matchingrules.MatchingRule)1 MaxTypeMatcher (au.com.dius.pact.core.model.matchingrules.MaxTypeMatcher)1 MinTypeMatcher (au.com.dius.pact.core.model.matchingrules.MinTypeMatcher)1 Test (org.junit.Test)1