WIP
[demos/example-siren] / spring-consumer / target / pacts / SpringConsumer-Siren Order Provider.json
index 323956d..aa58b36 100644 (file)
       },
       "response": {
         "body": {
+          "actions": [
+            {
+              "href": "http://localhost:8080/RegexpMatcher(regex=\\d+, value=1234)",
+              "method": "PUT",
+              "name": "update"
+            }
+          ],
+          "entities": [
 
+          ]
         },
-        "headers": {
-          "Content-Type": "application/vnd.siren+json"
+        "generators": {
+          "body": {
+            "$[0].href": {
+              "example": "http://localhost:8080/RegexpMatcher(regex=\\d+, value=1234)",
+              "regex": ".*\\/(\\QRegexpMatcher(regex=\\d+, value=1234)\\E)$",
+              "type": "MockServerURL"
+            }
+          }
         },
-        "status": 200
-      }
-    },
-    {
-      "description": "get root",
-      "request": {
-        "method": "GET",
-        "path": "/"
-      },
-      "response": {
         "headers": {
           "Content-Type": "application/vnd.siren+json"
         },
+        "matchingRules": {
+          "body": {
+            "$.actions": {
+              "combine": "AND",
+              "matchers": [
+                {
+                  "match": "arrayContains",
+                  "variants": [
+                    {
+                      "generators": {
+                        "$.href": {
+                          "example": "http://localhost:8080/RegexpMatcher(regex=\\d+, value=1234)",
+                          "regex": ".*\\/(\\QRegexpMatcher(regex=\\d+, value=1234)\\E)$",
+                          "type": "MockServerURL"
+                        }
+                      },
+                      "index": 0,
+                      "rules": {
+                        "$.href": {
+                          "combine": "AND",
+                          "matchers": [
+                            {
+                              "match": "regex",
+                              "regex": ".*\\/(\\QRegexpMatcher(regex=\\d+, value=1234)\\E)$"
+                            }
+                          ]
+                        },
+                        "$.method": {
+                          "combine": "AND",
+                          "matchers": [
+                            {
+                              "match": "type"
+                            }
+                          ]
+                        },
+                        "$.name": {
+                          "combine": "AND",
+                          "matchers": [
+                            {
+                              "match": "type"
+                            }
+                          ]
+                        }
+                      }
+                    }
+                  ]
+                }
+              ]
+            }
+          }
+        },
         "status": 200
       }
     }