Re-staged the contract for `get all orders`
[demos/example-siren] / spring-consumer / target / pacts / SpringConsumer-SirenOrderProvider.json
diff --git a/spring-consumer/target/pacts/SpringConsumer-SirenOrderProvider.json b/spring-consumer/target/pacts/SpringConsumer-SirenOrderProvider.json
new file mode 100644 (file)
index 0000000..1d1fbd3
--- /dev/null
@@ -0,0 +1,223 @@
+{
+  "consumer": {
+    "name": "SpringConsumer"
+  },
+  "interactions": [
+    {
+      "description": "get all orders",
+      "request": {
+        "method": "GET",
+        "path": "/orders"
+      },
+      "response": {
+        "body": {
+          "class": [
+            "entity"
+          ],
+          "entities": [
+            {
+              "actions": [
+                {
+                  "href": "http://localhost:8080/orders/1234",
+                  "method": "PUT",
+                  "name": "update"
+                },
+                {
+                  "href": "http://localhost:8080/orders/1234",
+                  "method": "DELETE",
+                  "name": "delete"
+                }
+              ],
+              "class": [
+                "entity"
+              ],
+              "links": [
+                {
+                  "href": "http://localhost:8080/orders/1234",
+                  "rel": [
+                    "self"
+                  ]
+                }
+              ],
+              "properties": {
+                "id": 1234
+              },
+              "rel": [
+                "item"
+              ]
+            }
+          ],
+          "links": [
+            {
+              "href": "http://localhost:8080/orders",
+              "rel": [
+                "self"
+              ]
+            }
+          ]
+        },
+        "generators": {
+          "body": {
+            "$.entities[*].links[0].href": {
+              "example": "http://localhost:8080/orders/1234",
+              "regex": ".*\\/(\\Qorders\\E\\/\\d+)$",
+              "type": "MockServerURL"
+            },
+            "$.entities[*][0].href": {
+              "example": "http://localhost:8080/orders/1234",
+              "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$",
+              "type": "MockServerURL"
+            },
+            "$.entities[*][1].href": {
+              "example": "http://localhost:8080/orders/1234",
+              "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$",
+              "type": "MockServerURL"
+            },
+            "$.links[0].href": {
+              "example": "http://localhost:8080/orders",
+              "regex": ".*\\/(\\Qorders\\E)$",
+              "type": "MockServerURL"
+            }
+          }
+        },
+        "headers": {
+          "Content-Type": "application/vnd.siren+json"
+        },
+        "matchingRules": {
+          "body": {
+            "$.entities": {
+              "combine": "AND",
+              "matchers": [
+                {
+                  "match": "type"
+                }
+              ]
+            },
+            "$.entities[*].actions": {
+              "combine": "AND",
+              "matchers": [
+                {
+                  "match": "arrayContains",
+                  "variants": [
+                    {
+                      "generators": {
+                        "$.href": {
+                          "example": "http://localhost:8080/orders/1234",
+                          "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$",
+                          "type": "MockServerURL"
+                        }
+                      },
+                      "index": 0,
+                      "rules": {
+                        "$.href": {
+                          "combine": "AND",
+                          "matchers": [
+                            {
+                              "match": "regex",
+                              "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$"
+                            }
+                          ]
+                        },
+                        "$.method": {
+                          "combine": "AND",
+                          "matchers": [
+                            {
+                              "match": "type"
+                            }
+                          ]
+                        },
+                        "$.name": {
+                          "combine": "AND",
+                          "matchers": [
+                            {
+                              "match": "type"
+                            }
+                          ]
+                        }
+                      }
+                    },
+                    {
+                      "generators": {
+                        "$.href": {
+                          "example": "http://localhost:8080/orders/1234",
+                          "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$",
+                          "type": "MockServerURL"
+                        }
+                      },
+                      "index": 1,
+                      "rules": {
+                        "$.href": {
+                          "combine": "AND",
+                          "matchers": [
+                            {
+                              "match": "regex",
+                              "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$"
+                            }
+                          ]
+                        },
+                        "$.method": {
+                          "combine": "AND",
+                          "matchers": [
+                            {
+                              "match": "type"
+                            }
+                          ]
+                        },
+                        "$.name": {
+                          "combine": "AND",
+                          "matchers": [
+                            {
+                              "match": "type"
+                            }
+                          ]
+                        }
+                      }
+                    }
+                  ]
+                }
+              ]
+            },
+            "$.entities[*].links[0].href": {
+              "combine": "AND",
+              "matchers": [
+                {
+                  "match": "regex",
+                  "regex": ".*\\/(\\Qorders\\E\\/\\d+)$"
+                }
+              ]
+            },
+            "$.entities[*].properties.id": {
+              "combine": "AND",
+              "matchers": [
+                {
+                  "match": "integer"
+                }
+              ]
+            },
+            "$.links[0].href": {
+              "combine": "AND",
+              "matchers": [
+                {
+                  "match": "regex",
+                  "regex": ".*\\/(\\Qorders\\E)$"
+                }
+              ]
+            }
+          }
+        },
+        "status": 200
+      }
+    }
+  ],
+  "metadata": {
+    "pact-jvm": {
+      "version": "4.2.2"
+    },
+    "pactSpecification": {
+      "version": "3.0.0"
+    }
+  },
+  "provider": {
+    "name": "SirenOrderProvider"
+  }
+}