WIP
authorKai Moritz <kai@juplo.de>
Sat, 21 May 2022 15:36:11 +0000 (17:36 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 21 May 2022 15:36:11 +0000 (17:36 +0200)
spring-consumer/src/test/java/de/juplo/demos/pact/ContractTest.java
spring-consumer/target/pacts/SpringConsumer-Siren Order Provider.json

index 2e89474..c97432b 100644 (file)
@@ -32,6 +32,10 @@ public class ContractTest
             .headers(Map.of("Content-Type", "application/vnd.siren+json"))
             .body(LambdaDsl.newJsonBody(body ->
             {
+              body.arrayContaining("actions", actions ->
+              {
+                actions.stringType("foo");
+              });
             }).build())
         .toPact();
   }
index 323956d..d14b5d0 100644 (file)
       },
       "response": {
         "body": {
-
+          "actions": [
+            "foo"
+          ]
         },
         "headers": {
           "Content-Type": "application/vnd.siren+json"
         },
+        "matchingRules": {
+          "body": {
+            "$.actions": {
+              "combine": "AND",
+              "matchers": [
+                {
+                  "match": "arrayContains",
+                  "variants": [
+                    {
+                      "generators": {
+
+                      },
+                      "index": 0,
+                      "rules": {
+                        "$": {
+                          "combine": "AND",
+                          "matchers": [
+                            {
+                              "match": "type"
+                            }
+                          ]
+                        }
+                      }
+                    }
+                  ]
+                }
+              ]
+            }
+          }
+        },
         "status": 200
       }
     },