X-Git-Url: http://juplo.de/gitweb/?a=blobdiff_plain;f=spring-consumer%2Fsrc%2Ftest%2Fjava%2Fde%2Fjuplo%2Fdemos%2Fpact%2FContractTest.java;h=85d40b03afa26b254377de1abd81b68ece202ea2;hb=183534d582820e19c578cc03c3b60b37218b8554;hp=0e62c481561ec268149da618c24328de3a28357c;hpb=338294ec4a33a6da926d6ef11980720ce0b7739c;p=demos%2Fexample-siren 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 0e62c48..85d40b0 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 @@ -12,7 +12,6 @@ import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.web.client.RestTemplate; import java.util.Map; -import java.util.regex.Pattern; import static org.assertj.core.api.Assertions.fail; @@ -33,13 +32,16 @@ public class ContractTest .headers(Map.of("Content-Type", "application/vnd.siren+json")) .body(LambdaDsl.newJsonBody(body -> { - body.arrayContaining("actions", actions -> + body.array("entities", entities -> { - actions.object(object -> + body.arrayContaining("actions", actions -> { - object.stringType("name","update"); - object.stringType("method", "PUT"); - object.matchUrl2("href", Matchers.regexp("\\d+", "1234")); + actions.object(object -> + { + object.stringType("name","update"); + object.stringType("method", "PUT"); + object.matchUrl2("href", Matchers.regexp("\\d+", "1234")); + }); }); }); }).build())