From: Kai Moritz Date: Sat, 21 May 2022 15:37:49 +0000 (+0200) Subject: WIP X-Git-Tag: wip-umbau-array-contains~10 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=c4518c1bc18bcd594fe1a2b79be399877ce1c9b5;p=demos%2Fexample-siren WIP --- 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 c97432b..0e43145 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 @@ -34,7 +34,10 @@ public class ContractTest { body.arrayContaining("actions", actions -> { - actions.stringType("foo"); + actions.object(object -> + { + object.stringType("foo"); + }); }); }).build()) .toPact(); diff --git a/spring-consumer/target/pacts/SpringConsumer-Siren Order Provider.json b/spring-consumer/target/pacts/SpringConsumer-Siren Order Provider.json index d14b5d0..1b63847 100644 --- a/spring-consumer/target/pacts/SpringConsumer-Siren Order Provider.json +++ b/spring-consumer/target/pacts/SpringConsumer-Siren Order Provider.json @@ -12,9 +12,19 @@ "response": { "body": { "actions": [ - "foo" + { + "foo": "string" + } ] }, + "generators": { + "body": { + "$[0].foo": { + "size": 20, + "type": "RandomString" + } + } + }, "headers": { "Content-Type": "application/vnd.siren+json" }, @@ -28,11 +38,14 @@ "variants": [ { "generators": { - + "$.foo": { + "size": 20, + "type": "RandomString" + } }, "index": 0, "rules": { - "$": { + "$.foo": { "combine": "AND", "matchers": [ {