X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=spring-consumer%2Ftarget%2Fpacts%2FSpringConsumer-Siren%20Order%20Provider.json;h=ae1e66d08675c1df91e5b2efa86678f6a11f9147;hb=d9dcdbe4ecf53103212af0045ea8599f90a4e45e;hp=2ae8cea9a7d75025295699597d674afd54cb5237;hpb=7a8c1cc6f0ff8a7cc3e1778574310a094c7e9688;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 2ae8cea..ae1e66d 100644 --- a/spring-consumer/target/pacts/SpringConsumer-Siren Order Provider.json +++ b/spring-consumer/target/pacts/SpringConsumer-Siren Order Provider.json @@ -11,22 +11,49 @@ }, "response": { "body": { - "age": 100, - "happy": true, - "id": 1234567890, - "localAddress": "127.0.0.1", - "name": "string" + "actions": [ + { + "href": "http://localhost:8080/1234", + "method": "PUT", + "name": "update" + }, + { + "href": "http://localhost:8080/1234", + "method": "DELETE", + "name": "delete" + } + ], + "class": [ + "entity" + ], + "entities": [ + + ], + "links": [ + { + "href": "http://localhost:8080/orders", + "rel": [ + "self" + ] + } + ] }, "generators": { "body": { - "$.id": { - "max": 2147483647, - "min": 0, - "type": "RandomInt" + "$.links[0].href": { + "example": "http://localhost:8080/orders", + "regex": ".*\\/(\\Qorders\\E)$", + "type": "MockServerURL" }, - "$.name": { - "size": 20, - "type": "RandomString" + "$[0].href": { + "example": "http://localhost:8080/1234", + "regex": ".*\\/(\\Q1234\\E)$", + "type": "MockServerURL" + }, + "$[1].href": { + "example": "http://localhost:8080/1234", + "regex": ".*\\/(\\Q1234\\E)$", + "type": "MockServerURL" } } }, @@ -35,36 +62,96 @@ }, "matchingRules": { "body": { - "$.happy": { - "combine": "AND", - "matchers": [ - { - "match": "type" - } - ] - }, - "$.id": { + "$.actions": { "combine": "AND", "matchers": [ { - "match": "type" + "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" + } + ] + } + } + } + ] } ] }, - "$.localAddress": { + "$.links[0].href": { "combine": "AND", "matchers": [ { "match": "regex", - "regex": "(\\d{1,3}\\.)+\\d{1,3}" - } - ] - }, - "$.name": { - "combine": "AND", - "matchers": [ - { - "match": "type" + "regex": ".*\\/(\\Qorders\\E)$" } ] } @@ -72,19 +159,6 @@ }, "status": 200 } - }, - { - "description": "get root", - "request": { - "method": "GET", - "path": "/" - }, - "response": { - "headers": { - "Content-Type": "application/vnd.siren+json" - }, - "status": 200 - } } ], "metadata": {