X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=spring-consumer%2Ftarget%2Fpacts%2FSpringConsumer-Siren%20Order%20Provider.json;h=f04e0d3ad98d3206b6ea0124a36df68414a94642;hb=ed43e281465ce468df3f20a782ec47e5966e9f0d;hp=953d4e6792a35f7aafebd12078deef261f464f55;hpb=d553ddf4d0da98b4999f609422e87fe9881148b1;p=demos%2Fexample-siren diff --git a/spring-consumer/target/pacts/SpringConsumer-Siren Order Provider.json b/spring-consumer/target/pacts/SpringConsumer-Siren Order Provider.json index 953d4e6..f04e0d3 100644 --- a/spring-consumer/target/pacts/SpringConsumer-Siren Order Provider.json +++ b/spring-consumer/target/pacts/SpringConsumer-Siren Order Provider.json @@ -11,27 +11,74 @@ }, "response": { "body": { - "age": 100, - "happy": true, - "hexCode": "1234a", - "id": 1234567890, - "localAddress": "127.0.0.1", - "name": "string" + "class": [ + "entity" + ], + "entities": [ + [ + { + "action": [ + { + "href": "http://localhost:8080/1234", + "method": "PUT", + "name": "update" + }, + { + "href": "http://localhost:8080/1234", + "method": "DELETE", + "name": "delete" + } + ], + "class": [ + "entity" + ], + "links": [ + { + "href": "http://localhost:8080/orders/RegexpMatcher(regex=\\d+, value=1234)", + "rel": [ + "self" + ] + } + ], + "properties": { + "id": "1234", + "rel": [ + "item" + ] + } + } + ] + ], + "links": [ + { + "href": "http://localhost:8080/orders", + "rel": [ + "self" + ] + } + ] }, "generators": { "body": { - "$.hexCode": { - "digits": 10, - "type": "RandomHexadecimal" + "$.entities[0].entities[*].links[0].href": { + "example": "http://localhost:8080/orders/RegexpMatcher(regex=\\d+, value=1234)", + "regex": ".*\\/(\\Qorders\\E\\/\\QRegexpMatcher(regex=\\d+, value=1234)\\E)$", + "type": "MockServerURL" }, - "$.id": { - "max": 2147483647, - "min": 0, - "type": "RandomInt" + "$.entities[0].entities[*][0].href": { + "example": "http://localhost:8080/1234", + "regex": ".*\\/(\\Q1234\\E)$", + "type": "MockServerURL" }, - "$.name": { - "size": 20, - "type": "RandomString" + "$.entities[0].entities[*][1].href": { + "example": "http://localhost:8080/1234", + "regex": ".*\\/(\\Q1234\\E)$", + "type": "MockServerURL" + }, + "$.links[0].href": { + "example": "http://localhost:8080/orders", + "regex": ".*\\/(\\Qorders\\E)$", + "type": "MockServerURL" } } }, @@ -40,7 +87,7 @@ }, "matchingRules": { "body": { - "$.happy": { + "$.entities[0]": { "combine": "AND", "matchers": [ { @@ -48,37 +95,113 @@ } ] }, - "$.hexCode": { + "$.entities[0].entities[*].action": { "combine": "AND", "matchers": [ { - "match": "regex", - "regex": "[0-9a-fA-F]+" + "match": "arrayContains", + "variants": [ + { + "generators": { + "$.href": { + "example": "http://localhost:8080/1234", + "regex": ".*\\/(\\Q1234\\E)$", + "type": "MockServerURL" + } + }, + "index": 0, + "rules": { + "$.href": { + "combine": "AND", + "matchers": [ + { + "match": "regex", + "regex": ".*\\/(\\Q1234\\E)$" + } + ] + }, + "$.method": { + "combine": "AND", + "matchers": [ + { + "match": "type" + } + ] + }, + "$.name": { + "combine": "AND", + "matchers": [ + { + "match": "type" + } + ] + } + } + }, + { + "generators": { + "$.href": { + "example": "http://localhost:8080/1234", + "regex": ".*\\/(\\Q1234\\E)$", + "type": "MockServerURL" + } + }, + "index": 1, + "rules": { + "$.href": { + "combine": "AND", + "matchers": [ + { + "match": "regex", + "regex": ".*\\/(\\Q1234\\E)$" + } + ] + }, + "$.method": { + "combine": "AND", + "matchers": [ + { + "match": "type" + } + ] + }, + "$.name": { + "combine": "AND", + "matchers": [ + { + "match": "type" + } + ] + } + } + } + ] } ] }, - "$.id": { + "$.entities[0].entities[*].links[0].href": { "combine": "AND", "matchers": [ { - "match": "type" + "match": "regex", + "regex": ".*\\/(\\Qorders\\E\\/\\QRegexpMatcher(regex=\\d+, value=1234)\\E)$" } ] }, - "$.localAddress": { + "$.entities[0].entities[*].properties.id": { "combine": "AND", "matchers": [ { - "match": "regex", - "regex": "(\\d{1,3}\\.)+\\d{1,3}" + "match": "type" } ] }, - "$.name": { + "$.links[0].href": { "combine": "AND", "matchers": [ { - "match": "type" + "match": "regex", + "regex": ".*\\/(\\Qorders\\E)$" } ] } @@ -86,19 +209,6 @@ }, "status": 200 } - }, - { - "description": "get root", - "request": { - "method": "GET", - "path": "/" - }, - "response": { - "headers": { - "Content-Type": "application/vnd.siren+json" - }, - "status": 200 - } } ], "metadata": {