package de.juplo.demos.pact;
import au.com.dius.pact.consumer.MockServer;
-import au.com.dius.pact.consumer.dsl.LambdaDsl;
-import au.com.dius.pact.consumer.dsl.PactDslJsonBody;
-import au.com.dius.pact.consumer.dsl.PactDslJsonRootValue;
-import au.com.dius.pact.consumer.dsl.PactDslWithProvider;
+import au.com.dius.pact.consumer.dsl.*;
import au.com.dius.pact.consumer.junit5.PactConsumerTestExt;
import au.com.dius.pact.consumer.junit5.PactTestFor;
import au.com.dius.pact.core.model.RequestResponsePact;
.headers(Map.of("Content-Type", "application/vnd.siren+json"))
.body(LambdaDsl.newJsonBody(body ->
{
- body.stringType("name");
- body.booleanType("happy");
- // body.hexValue("hexCode");
- body.id();
- body.ipV4Address("localAddress");
- body.numberValue("age", 100);
+ body.arrayContaining("actions", actions ->
+ {
+ actions.object(object ->
+ {
+ object.stringValue("name", "update");
+ object.stringValue("method", "PUT");
+
+ });
+ });
}).build())
.toPact();
}