From 617d9a6e950ab56d847cdc75cb71fada9a1e7153 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 21 May 2022 17:28:45 +0200 Subject: [PATCH] WIP --- .../de/juplo/demos/pact/ContractTest.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/spring-consumer/src/test/java/de/juplo/demos/pact/ContractTest.java b/spring-consumer/src/test/java/de/juplo/demos/pact/ContractTest.java index 8db0dbc..dd2e149 100644 --- a/spring-consumer/src/test/java/de/juplo/demos/pact/ContractTest.java +++ b/spring-consumer/src/test/java/de/juplo/demos/pact/ContractTest.java @@ -1,10 +1,7 @@ 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; @@ -35,12 +32,15 @@ public class ContractTest .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(); } -- 2.20.1