From c4518c1bc18bcd594fe1a2b79be399877ce1c9b5 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 21 May 2022 17:37:49 +0200 Subject: [PATCH] WIP --- .../de/juplo/demos/pact/ContractTest.java | 5 ++++- .../SpringConsumer-Siren Order Provider.json | 19 ++++++++++++++++--- 2 files changed, 20 insertions(+), 4 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 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": [ { -- 2.20.1