X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=spring-consumer%2Ftarget%2Fpacts%2FSpringConsumer-SirenOrderProvider.json;fp=spring-consumer%2Ftarget%2Fpacts%2FSpringConsumer-SirenOrderProvider.json;h=1d1fbd35e2962d1c5f147fc0e972d6a4403ab90f;hb=2faa2b692bd69773d5d60299b835de06c999991d;hp=0000000000000000000000000000000000000000;hpb=e492dc86a132c3a56b6cbb0dd4c40f60258aaa7a;p=demos%2Fexample-siren diff --git a/spring-consumer/target/pacts/SpringConsumer-SirenOrderProvider.json b/spring-consumer/target/pacts/SpringConsumer-SirenOrderProvider.json new file mode 100644 index 0000000..1d1fbd3 --- /dev/null +++ b/spring-consumer/target/pacts/SpringConsumer-SirenOrderProvider.json @@ -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" + } +}