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=aa58b365927e5271a9fbf3cf4d4dc019f6fb4119;hpb=183534d582820e19c578cc03c3b60b37218b8554;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 aa58b36..f04e0d3 100644 --- a/spring-consumer/target/pacts/SpringConsumer-Siren Order Provider.json +++ b/spring-consumer/target/pacts/SpringConsumer-Siren Order Provider.json @@ -11,22 +11,73 @@ }, "response": { "body": { - "actions": [ - { - "href": "http://localhost:8080/RegexpMatcher(regex=\\d+, value=1234)", - "method": "PUT", - "name": "update" - } + "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": { - "$[0].href": { - "example": "http://localhost:8080/RegexpMatcher(regex=\\d+, value=1234)", - "regex": ".*\\/(\\QRegexpMatcher(regex=\\d+, value=1234)\\E)$", + "$.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" + }, + "$.entities[0].entities[*][0].href": { + "example": "http://localhost:8080/1234", + "regex": ".*\\/(\\Q1234\\E)$", + "type": "MockServerURL" + }, + "$.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" } } @@ -36,7 +87,15 @@ }, "matchingRules": { "body": { - "$.actions": { + "$.entities[0]": { + "combine": "AND", + "matchers": [ + { + "match": "type" + } + ] + }, + "$.entities[0].entities[*].action": { "combine": "AND", "matchers": [ { @@ -45,8 +104,8 @@ { "generators": { "$.href": { - "example": "http://localhost:8080/RegexpMatcher(regex=\\d+, value=1234)", - "regex": ".*\\/(\\QRegexpMatcher(regex=\\d+, value=1234)\\E)$", + "example": "http://localhost:8080/1234", + "regex": ".*\\/(\\Q1234\\E)$", "type": "MockServerURL" } }, @@ -57,7 +116,44 @@ "matchers": [ { "match": "regex", - "regex": ".*\\/(\\QRegexpMatcher(regex=\\d+, value=1234)\\E)$" + "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)$" } ] }, @@ -82,6 +178,32 @@ ] } ] + }, + "$.entities[0].entities[*].links[0].href": { + "combine": "AND", + "matchers": [ + { + "match": "regex", + "regex": ".*\\/(\\Qorders\\E\\/\\QRegexpMatcher(regex=\\d+, value=1234)\\E)$" + } + ] + }, + "$.entities[0].entities[*].properties.id": { + "combine": "AND", + "matchers": [ + { + "match": "type" + } + ] + }, + "$.links[0].href": { + "combine": "AND", + "matchers": [ + { + "match": "regex", + "regex": ".*\\/(\\Qorders\\E)$" + } + ] } } },