Search in sources :

Example 1 with V4Pact

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

the class V4PactBuilderTest method messageInteraction.

@Pact(consumer = "v4_test_consumer")
V4Pact messageInteraction(PactBuilder builder) {
    PactDslJsonBody body = new PactDslJsonBody();
    body.stringValue("testParam1", "value1");
    body.stringValue("testParam2", "value2");
    Map<String, Object> metadata = new HashMap<>();
    metadata.put("destination", Matchers.regexp("\\w+\\d+", "X001"));
    return builder.usingLegacyMessageDsl().given("SomeProviderState").expectsToReceive("a test message").withMetadata(metadata).withContent(body).toPact();
}
Also used : HashMap(java.util.HashMap) PactDslJsonBody(au.com.dius.pact.consumer.dsl.PactDslJsonBody) V4Pact(au.com.dius.pact.core.model.V4Pact) Pact(au.com.dius.pact.core.model.annotations.Pact)

Aggregations

PactDslJsonBody (au.com.dius.pact.consumer.dsl.PactDslJsonBody)1 V4Pact (au.com.dius.pact.core.model.V4Pact)1 Pact (au.com.dius.pact.core.model.annotations.Pact)1 HashMap (java.util.HashMap)1