{ "consumer": { "name": "Pact Broker Client" }, "provider": { "name": "Pact Broker" }, "interactions": [ { "description": "a request to list the latest pacts", "providerState": "a pact between Condor and the Pricing Service exists", "request": { "method": "get", "path": "/pacts/latest", "headers": { } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json" }, "body": { "_links": { "self": { "href": "http://example.org/pacts/latest" } }, "pacts": [ { "_links": { "self": [ { "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/latest" }, { "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0" } ] }, "_embedded": { "consumer": { "name": "Condor", "_links": { "self": { "href": "http://example.org/pacticipants/Condor" } }, "_embedded": { "version": { "number": "1.3.0" } } }, "provider": { "_links": { "self": { "href": "http://example.org/pacticipants/Pricing%20Service" } }, "name": "Pricing Service" } } } ] }, "matchingRules": { "$.headers.Content-Type": { "match": "regex", "regex": "application\\/hal\\+json" } } } }, { "description": "a request to list pacticipants", "providerState": "'Condor' exists in the pact-broker", "request": { "method": "get", "path": "/pacticipants", "headers": { } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json" }, "body": { "_links": { "self": { "href": "http://example.org/pacticipants" }, "pacticipants": [ { "href": "http://example.org/pacticipants/Condor", "title": "Condor" } ] }, "pacticipants": [ { "_links": { "self": { "href": "http://example.org/pacticipants/Condor" } }, "name": "Condor", "_embedded": { "latest-version": { "_links": { "self": { "href": "http://example.org/pacticipants/Condor/versions/1.3.0" } }, "number": "1.3.0" } } } ] }, "matchingRules": { "$.headers.Content-Type": { "match": "regex", "regex": "application\\/hal\\+json" } } } }, { "description": "a request to get the Pricing Service", "providerState": "the 'Pricing Service' already exists in the pact-broker", "request": { "method": "get", "path": "/pacticipants/Pricing%20Service", "headers": { } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json" }, "body": { "_links": { "self": { "href": "http://example.org/pacticipants/Pricing%20Service" }, "versions": { "href": "http://example.org/pacticipants/Pricing%20Service/versions" } }, "name": "Pricing Service", "repositoryUrl": "git@git.realestate.com.au:business-systems/pricing-service", "_embedded": { "latest-version": { "_links": { "self": { "href": "http://example.org/pacticipants/Pricing%20Service/versions/1.3.0" } }, "number": "1.3.0" } } }, "matchingRules": { "$.headers.Content-Type": { "match": "regex", "regex": "application\\/hal\\+json" } } } }, { "description": "a request to get the Pricing Service", "providerState": "the 'Pricing Service' does not exist in the pact-broker", "request": { "method": "get", "path": "/pacticipants/Pricing%20Service", "headers": { } }, "response": { "status": 404, "headers": { } } }, { "description": "a request for the index resource", "providerState": "the pb:pacticipant-version relation exists in the index resource", "request": { "method": "get", "path": "/", "headers": { "Accept": "application/hal+json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "pb:pacticipant-version": { "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-INDEX-PB-PACTICIPANT-VERSION-{pacticipant}-{version}" } } }, "matchingRules": { "$.body._links.pb:pacticipant-version.href": { "match": "regex", "regex": "http:\\/\\/.*{pacticipant}.*{version}" } } } }, { "description": "a request to create a pacticipant version", "providerState": "version 26f353580936ad3b9baddb17b00e84f33c69e7cb of pacticipant Foo does not exist", "request": { "method": "put", "path": "/HAL-REL-PLACEHOLDER-INDEX-PB-PACTICIPANT-VERSION-Foo-26f353580936ad3b9baddb17b00e84f33c69e7cb", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json" }, "body": { "branch": "main", "buildUrl": "http://my-ci/builds/1" } }, "response": { "status": 201, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "number": "26f353580936ad3b9baddb17b00e84f33c69e7cb", "buildUrl": "http://my-ci/builds/1", "_links": { "self": { "href": "http://localhost:1234/some-url" } } }, "matchingRules": { "$.body._links.self.href": { "match": "regex", "regex": "http:\\/\\/.*" } } } }, { "description": "a request to create a pacticipant version", "providerState": "version 26f353580936ad3b9baddb17b00e84f33c69e7cb of pacticipant Foo does exist", "request": { "method": "put", "path": "/HAL-REL-PLACEHOLDER-INDEX-PB-PACTICIPANT-VERSION-Foo-26f353580936ad3b9baddb17b00e84f33c69e7cb", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json" }, "body": { "branch": "main", "buildUrl": "http://my-ci/builds/1" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "number": "26f353580936ad3b9baddb17b00e84f33c69e7cb", "buildUrl": "http://my-ci/builds/1", "_links": { "self": { "href": "http://localhost:1234/some-url" } } }, "matchingRules": { "$.body._links.self.href": { "match": "regex", "regex": "http:\\/\\/.*" } } } }, { "description": "a request to determine if Bar can be deployed with all Foo tagged prod, ignoring the verification for Foo version 3.4.5", "providerState": "provider Bar version 4.5.6 has a successful verification for Foo version 1.2.3 tagged prod and a failed verification for version 3.4.5 tagged prod", "request": { "method": "get", "path": "/matrix", "query": "q%5B%5D%5Bpacticipant%5D=Bar&q%5B%5D%5Bversion%5D=4.5.6&q%5B%5D%5Bpacticipant%5D=Foo&q%5B%5D%5Btag%5D=prod&latestby=cvpv&ignore%5B%5D%5Bpacticipant%5D=Foo&ignore%5B%5D%5Bversion%5D=3.4.5" }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "summary": { "deployable": true, "ignored": 1 }, "notices": [ { "text": "some notice", "type": "info" } ], "matrix": [ { "consumer": { "name": "Foo", "version": { "number": "1.2.3" } }, "provider": { "name": "Bar", "version": { "number": "4.5.6" } }, "verificationResult": { "success": true, "_links": { "self": { "href": "http://result" } } } }, { "consumer": { "name": "Foo", "version": { "number": "3.4.5" } }, "provider": { "name": "Bar", "version": { "number": "4.5.6" } }, "verificationResult": { "success": false, "_links": { "self": { "href": "http://result" } } }, "ignored": true } ] }, "matchingRules": { "$.body.notices": { "min": 1 }, "$.body.notices[*].*": { "match": "type" }, "$.body.matrix[0].verificationResult._links.self.href": { "match": "type" }, "$.body.matrix[1].verificationResult._links.self.href": { "match": "type" } } } }, { "description": "a request for the compatibility matrix for Foo version 1.2.3 and Bar version 4.5.6", "providerState": "the pact for Foo version 1.2.3 has been verified by Bar version 4.5.6", "request": { "method": "get", "path": "/matrix", "query": "q%5B%5D%5Bpacticipant%5D=Foo&q%5B%5D%5Bversion%5D=1.2.3&q%5B%5D%5Bpacticipant%5D=Bar&q%5B%5D%5Bversion%5D=4.5.6&latestby=cvpv" }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "summary": { "deployable": true, "reason": "some text", "unknown": 1 }, "matrix": [ { "consumer": { "name": "Foo", "version": { "number": "4" } }, "provider": { "name": "Bar", "version": { "number": "5" } }, "verificationResult": { "verifiedAt": "2017-10-10T12:49:04+11:00", "success": true, "_links": { "self": { "href": "http://result" } } }, "pact": { "createdAt": "2017-10-10T12:49:04+11:00" } } ] }, "matchingRules": { "$.body": { "match": "type" } } } }, { "description": "a request for the compatibility matrix for Foo version 1.2.3 and Bar version 4.5.6", "providerState": "the pact for Foo Thing version 1.2.3 has been verified by Bar version 4.5.6", "request": { "method": "get", "path": "/matrix", "query": "q%5B%5D%5Bpacticipant%5D=Foo%20Thing&q%5B%5D%5Bversion%5D=1.2.3&q%5B%5D%5Bpacticipant%5D=Bar&q%5B%5D%5Bversion%5D=4.5.6&latestby=cvpv" }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "summary": { "deployable": true, "reason": "some text", "unknown": 1 }, "matrix": [ { "consumer": { "name": "Foo", "version": { "number": "4" } }, "provider": { "name": "Bar", "version": { "number": "5" } }, "verificationResult": { "verifiedAt": "2017-10-10T12:49:04+11:00", "success": true, "_links": { "self": { "href": "http://result" } } }, "pact": { "createdAt": "2017-10-10T12:49:04+11:00" } } ] }, "matchingRules": { "$.body": { "match": "type" } } } }, { "description": "a request for the compatibility matrix where only the version of Foo is specified", "providerState": "the pact for Foo version 1.2.3 has been verified by Bar version 4.5.6 and version 5.6.7", "request": { "method": "get", "path": "/matrix", "query": "q%5B%5D%5Bpacticipant%5D=Foo&q%5B%5D%5Bversion%5D=1.2.3&latestby=cvp&latest=true" }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "summary": { "deployable": true, "reason": "some text", "unknown": 1 }, "matrix": [ { "consumer": { "name": "Foo", "version": { "number": "4" } }, "provider": { "name": "Bar", "version": { "number": "5" } }, "verificationResult": { "verifiedAt": "2017-10-10T12:49:04+11:00", "success": true, "_links": { "self": { "href": "http://result" } } }, "pact": { "createdAt": "2017-10-10T12:49:04+11:00" } } ] }, "matchingRules": { "$.body": { "match": "type" } } } }, { "description": "a request for the compatibility matrix where one or more versions does not exist", "providerState": "the pact for Foo version 1.2.3 has been verified by Bar version 4.5.6", "request": { "method": "get", "path": "/matrix", "query": "q%5B%5D%5Bpacticipant%5D=Foo&q%5B%5D%5Bversion%5D=1.2.3&q%5B%5D%5Bpacticipant%5D=Bar&q%5B%5D%5Bversion%5D=9.9.9&latestby=cvpv" }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "summary": { "reason": "an error message" } }, "matchingRules": { "$.body.summary.reason": { "match": "type" } } } }, { "description": "a request for the compatibility matrix for a pacticipant that does not exist", "request": { "method": "get", "path": "/matrix", "query": "q%5B%5D%5Bpacticipant%5D=Wiffle&q%5B%5D%5Bversion%5D=1.2.3&q%5B%5D%5Bpacticipant%5D=Meep&q%5B%5D%5Bversion%5D=9.9.9&latestby=cvpv" }, "response": { "status": 400, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "errors": [ "an error message" ] }, "matchingRules": { "$.body.errors": { "min": 1 }, "$.body.errors[*].*": { "match": "type" } } } }, { "description": "a request for the compatibility matrix for all versions of Foo and Bar", "providerState": "the pact for Foo version 1.2.3 and 1.2.4 has been verified by Bar version 4.5.6", "request": { "method": "get", "path": "/matrix", "query": "q%5B%5D%5Bpacticipant%5D=Foo&q%5B%5D%5Bpacticipant%5D=Bar&latestby=cvpv" }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "matrix": [ { "consumer": { "name": "Foo", "version": { "number": "4" } }, "provider": { "name": "Bar", "version": { "number": "5" } }, "verificationResult": { "verifiedAt": "2017-10-10T12:49:04+11:00", "success": true, "_links": { "self": { "href": "http://result" } } }, "pact": { "createdAt": "2017-10-10T12:49:04+11:00" } }, { "consumer": { "name": "Foo", "version": { "number": "4" } }, "provider": { "name": "Bar", "version": { "number": "5" } }, "verificationResult": { "verifiedAt": "2017-10-10T12:49:04+11:00", "success": true, "_links": { "self": { "href": "http://result" } } }, "pact": { "createdAt": "2017-10-10T12:49:04+11:00" } } ] }, "matchingRules": { "$.body.matrix": { "min": 2 }, "$.body.matrix[*].*": { "match": "type" } } } }, { "description": "a request for the successful rows of the compatibility matrix for all versions of Foo and Bar", "providerState": "the pact for Foo version 1.2.3 has been successfully verified by Bar version 4.5.6, and 1.2.4 unsuccessfully by 9.9.9", "request": { "method": "get", "path": "/matrix", "query": "q%5B%5D%5Bpacticipant%5D=Foo&q%5B%5D%5Bpacticipant%5D=Bar&latestby=cvpv&success%5B%5D=true" }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "summary": { "deployable": true, "reason": "some text", "unknown": 1 }, "matrix": [ { "consumer": { "name": "Foo", "version": { "number": "4" } }, "provider": { "name": "Bar", "version": { "number": "5" } }, "verificationResult": { "verifiedAt": "2017-10-10T12:49:04+11:00", "success": true, "_links": { "self": { "href": "http://result" } } }, "pact": { "createdAt": "2017-10-10T12:49:04+11:00" } } ] }, "matchingRules": { "$.body": { "match": "type" } } } }, { "description": "a request for the compatibility matrix for Foo version 1.2.3 and the latest prod version of Bar", "providerState": "the pact for Foo version 1.2.3 has been successfully verified by Bar version 4.5.6 with tag prod, and 1.2.4 unsuccessfully by 9.9.9", "request": { "method": "get", "path": "/matrix", "query": "q%5B%5D%5Bpacticipant%5D=Foo&q%5B%5D%5Bversion%5D=1.2.3&q%5B%5D%5Bpacticipant%5D=Bar&q%5B%5D%5Blatest%5D=true&q%5B%5D%5Btag%5D=prod&latestby=cvpv" }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "summary": { "deployable": true, "reason": "some text", "unknown": 1 }, "matrix": [ { "consumer": { "name": "Foo", "version": { "number": "4" } }, "provider": { "name": "Bar", "version": { "number": "5" } }, "verificationResult": { "verifiedAt": "2017-10-10T12:49:04+11:00", "success": true, "_links": { "self": { "href": "http://result" } } }, "pact": { "createdAt": "2017-10-10T12:49:04+11:00" } } ] }, "matchingRules": { "$.body": { "match": "type" } } } }, { "description": "a request for the compatibility matrix for Foo version 1.2.3 and the latest version of Bar", "providerState": "the pact for Foo version 1.2.3 has been successfully verified by Bar version 4.5.6, and 1.2.4 unsuccessfully by 9.9.9", "request": { "method": "get", "path": "/matrix", "query": "q%5B%5D%5Bpacticipant%5D=Foo&q%5B%5D%5Bversion%5D=1.2.4&q%5B%5D%5Bpacticipant%5D=Bar&q%5B%5D%5Blatest%5D=true&latestby=cvpv" }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "summary": { "deployable": true, "reason": "some text", "unknown": 1 }, "matrix": [ { "consumer": { "name": "Foo", "version": { "number": "4" } }, "provider": { "name": "Bar", "version": { "number": "5" } }, "verificationResult": { "verifiedAt": "2017-10-10T12:49:04+11:00", "success": true, "_links": { "self": { "href": "http://result" } } }, "pact": { "createdAt": "2017-10-10T12:49:04+11:00" } } ] }, "matchingRules": { "$.body": { "match": "type" } } } }, { "description": "a request for the compatibility matrix for Foo version 1.2.3 and the latest prod versions of all other pacticipants", "providerState": "the pact for Foo version 1.2.3 has been successfully verified by Bar version 4.5.6 (tagged prod) and version 5.6.7", "request": { "method": "get", "path": "/matrix", "query": "q%5B%5D%5Bpacticipant%5D=Foo&q%5B%5D%5Bversion%5D=1.2.3&latestby=cvp&latest=true&tag=prod" }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "matrix": [ { "consumer": { "name": "Foo", "version": { "number": "1.2.3" } }, "provider": { "name": "Bar", "version": { "number": "4.5.6" } } } ] } } }, { "description": "a request to publish a pact", "providerState": "the 'Pricing Service' already exists in the pact-broker", "request": { "method": "put", "path": "/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0", "headers": { "Content-Type": "application/json" }, "body": { "consumer": { "name": "Condor" }, "provider": { "name": "Pricing Service" }, "interactions": [ ] } }, "response": { "status": 201, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "pb:latest-pact-version": { "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/latest" } } } } }, { "description": "a request to publish a pact with method patch", "providerState": "the 'Pricing Service' and 'Condor' already exist in the pact-broker, and Condor already has a pact published for version 1.3.0", "request": { "method": "patch", "path": "/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0", "headers": { "Content-Type": "application/json" }, "body": { "consumer": { "name": "Condor" }, "provider": { "name": "Pricing Service" }, "interactions": [ ] } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "pb:latest-pact-version": { "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/latest" } } } } }, { "description": "a request to publish a pact with method put", "providerState": "the 'Pricing Service' and 'Condor' already exist in the pact-broker, and Condor already has a pact published for version 1.3.0", "request": { "method": "put", "path": "/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0", "headers": { "Content-Type": "application/json" }, "body": { "consumer": { "name": "Condor" }, "provider": { "name": "Pricing Service" }, "interactions": [ ] } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "pb:latest-pact-version": { "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/latest" } } } } }, { "description": "a request to publish a pact", "providerState": "'Condor' already exist in the pact-broker, but the 'Pricing Service' does not", "request": { "method": "put", "path": "/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0", "headers": { "Content-Type": "application/json" }, "body": { "consumer": { "name": "Condor" }, "provider": { "name": "Pricing Service" }, "interactions": [ ] } }, "response": { "status": 201, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "pb:latest-pact-version": { "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/latest" } } } } }, { "description": "a request to publish a pact", "providerState": "an error occurs while publishing a pact", "request": { "method": "put", "path": "/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0", "headers": { "Content-Type": "application/json" }, "body": { "consumer": { "name": "Condor" }, "provider": { "name": "Pricing Service" }, "interactions": [ ] } }, "response": { "status": 500, "headers": { "Content-Type": "application/hal+json" }, "body": { "error": { "message": "An error occurred" } }, "matchingRules": { "$.headers.Content-Type": { "match": "regex", "regex": "application\\/.*json" }, "$.body.error.message": { "match": "regex", "regex": ".*" } } } }, { "description": "a request to register the repository URL of a pacticipant", "providerState": "the 'Pricing Service' does not exist in the pact-broker", "request": { "method": "patch", "path": "/pacticipants/Pricing%20Service", "headers": { "Content-Type": "application/json" }, "body": { "repository_url": "git@git.realestate.com.au:business-systems/pricing-service" } }, "response": { "status": 201, "headers": { "Content-Type": "application/hal+json;charset=utf-8" } } }, { "description": "a request to register the repository URL of a pacticipant", "providerState": "the 'Pricing Service' already exists in the pact-broker", "request": { "method": "patch", "path": "/pacticipants/Pricing%20Service", "headers": { "Content-Type": "application/json" }, "body": { "repository_url": "git@git.realestate.com.au:business-systems/pricing-service" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" } } }, { "description": "a request for the list of the latest prod pacts from all consumers for the Pricing Service'", "providerState": "tagged as prod pact between Condor and the Pricing Service exists", "request": { "method": "get", "path": "/pacts/provider/Pricing%20Service/latest/prod", "headers": { } }, "response": { "status": 200, "headers": { }, "body": { "_links": { "provider": { "href": "http://example.org/pacticipants/Pricing%20Service", "title": "Pricing Service" }, "pb:pacts": [ { "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0", "title": "Pact between Condor (v1.3.0) and Pricing Service", "name": "Condor" } ] } }, "matchingRules": { "$.body": { "match": "type" } } } }, { "description": "a request for the list of the latest pacts from all consumers for the Pricing Service'", "providerState": "a latest pact between Condor and the Pricing Service exists", "request": { "method": "get", "path": "/pacts/provider/Pricing%20Service/latest", "headers": { } }, "response": { "status": 200, "headers": { }, "body": { "_links": { "provider": { "href": "http://example.org/pacticipants/Pricing%20Service", "title": "Pricing Service" }, "pb:pacts": [ { "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0", "title": "Pact between Condor (v1.3.0) and Pricing Service", "name": "Condor" } ] } }, "matchingRules": { "$.body": { "match": "type" } } } }, { "description": "a request retrieve a pact for a specific version", "providerState": "the 'Pricing Service' and 'Condor' already exist in the pact-broker, and Condor already has a pact published for version 1.3.0", "request": { "method": "get", "path": "/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0", "headers": { } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "consumer": { "name": "Condor" }, "provider": { "name": "Pricing Service" }, "interactions": [ ] } } }, { "description": "a request to retrieve the latest pact between Condor and the Pricing Service", "providerState": "a pact between Condor and the Pricing Service exists", "request": { "method": "get", "path": "/pacts/provider/Pricing%20Service/consumer/Condor/latest", "headers": { } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json", "X-Pact-Consumer-Version": "1.3.0" }, "body": { "consumer": { "name": "Condor" }, "provider": { "name": "Pricing Service" }, "interactions": [ ] }, "matchingRules": { "$.headers.Content-Type": { "match": "regex", "regex": "application\\/.*json" } } } }, { "description": "a request to retrieve the latest pact between Condor and the Pricing Service", "providerState": "no pact between Condor and the Pricing Service exists", "request": { "method": "get", "path": "/pacts/provider/Pricing%20Service/consumer/Condor/latest", "headers": { } }, "response": { "status": 404, "headers": { } } }, { "description": "a request to retrieve the pact between the production verison of Condor and the Pricing Service", "providerState": "a pact between Condor and the Pricing Service exists for the production version of Condor", "request": { "method": "get", "path": "/pacts/provider/Pricing%20Service/consumer/Condor/latest/prod", "headers": { "Accept": "application/hal+json, application/json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "consumer": { "name": "Condor" }, "provider": { "name": "Pricing Service" }, "interactions": [ ] } } }, { "description": "a request to tag the production version of Condor", "providerState": "'Condor' exists in the pact-broker", "request": { "method": "put", "path": "/pacticipants/Condor/versions/1.3.0/tags/prod", "headers": { "Content-Type": "application/json" } }, "response": { "status": 201, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "self": { "href": "http://localhost:1234/pacticipants/Condor/versions/1.3.0/tags/prod" } } }, "matchingRules": { "$.body._links.self.href": { "match": "regex", "regex": "http:\\/\\/.*\\/pacticipants\\/Condor\\/versions\\/1.3.0\\/tags\\/prod" } } } }, { "description": "a request to tag the production version of Condor", "providerState": "'Condor' does not exist in the pact-broker", "request": { "method": "put", "path": "/pacticipants/Condor/versions/1.3.0/tags/prod", "headers": { "Content-Type": "application/json" } }, "response": { "status": 201, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "self": { "href": "http://localhost:1234/pacticipants/Condor/versions/1.3.0/tags/prod" } } }, "matchingRules": { "$.body._links.self.href": { "match": "regex", "regex": "http:\\/\\/.*\\/pacticipants\\/Condor\\/versions\\/1.3.0\\/tags\\/prod" } } } }, { "description": "a request to tag the production version of Condor", "providerState": "'Condor' exists in the pact-broker with version 1.3.0, tagged with 'prod'", "request": { "method": "put", "path": "/pacticipants/Condor/versions/1.3.0/tags/prod", "headers": { "Content-Type": "application/json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "self": { "href": "http://localhost:1234/pacticipants/Condor/versions/1.3.0/tags/prod" } } }, "matchingRules": { "$.body._links.self.href": { "match": "regex", "regex": "http:\\/\\/.*\\/pacticipants\\/Condor\\/versions\\/1.3.0\\/tags\\/prod" } } } }, { "description": "a request for the index resource", "providerState": "the pb:latest-version relation exists in the index resource", "request": { "method": "get", "path": "/", "headers": { "Accept": "application/hal+json, application/json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "pb:latest-version": { "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-INDEX-PB-LATEST-VERSION-{pacticipant}" } } }, "matchingRules": { "$.body._links.pb:latest-version.href": { "match": "regex", "regex": "http:\\/\\/.*{pacticipant}" } } } }, { "description": "a request to retrieve the latest version of Condor", "providerState": "'Condor' exists in the pact-broker with the latest version 1.2.3", "request": { "method": "get", "path": "/HAL-REL-PLACEHOLDER-INDEX-PB-LATEST-VERSION-Condor", "headers": { "Accept": "application/hal+json, application/json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "number": "1.2.3", "_links": { "self": { "href": "http://localhost:1234/some-url" } } }, "matchingRules": { "$.body._links.self.href": { "match": "regex", "regex": "http:\\/\\/.*" } } } }, { "description": "a request for the index resource", "providerState": "the pb:latest-tagged-version relation exists in the index resource", "request": { "method": "get", "path": "/", "headers": { "Accept": "application/hal+json, application/json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "pb:latest-tagged-version": { "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-INDEX-PB-LATEST-TAGGED-VERSION-{pacticipant}-{tag}" } } }, "matchingRules": { "$.body._links.pb:latest-tagged-version.href": { "match": "regex", "regex": "http:\\/\\/.*{pacticipant}.*{tag}" } } } }, { "description": "a request to retrieve the latest 'production' version of Condor", "providerState": "'Condor' exists in the pact-broker with the latest tagged 'production' version 1.2.3", "request": { "method": "get", "path": "/HAL-REL-PLACEHOLDER-INDEX-PB-LATEST-TAGGED-VERSION-Condor-production", "headers": { "Accept": "application/hal+json, application/json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "number": "1.2.3", "_links": { "self": { "href": "http://localhost:1234/some-url" } } }, "matchingRules": { "$.body._links.self.href": { "match": "regex", "regex": "http:\\/\\/.*" } } } }, { "description": "a request for the index resource", "providerState": "the pacticipant relations are present", "request": { "method": "get", "path": "/", "headers": { "Accept": "application/hal+json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "pb:pacticipants": { "href": "http://localhost:1234/pacticipants" }, "pb:pacticipant": { "href": "http://localhost:1234/pacticipants/{pacticipant}" } } }, "matchingRules": { "$.body._links.pb:pacticipants.href": { "match": "regex", "regex": "http:\\/\\/.*" }, "$.body._links.pb:pacticipant.href": { "match": "regex", "regex": "http:\\/\\/.*\\{pacticipant\\}" } } } }, { "description": "a request to retrieve a pacticipant", "request": { "method": "get", "path": "/pacticipants/Foo", "headers": { "Accept": "application/hal+json" } }, "response": { "status": 404, "headers": { } } }, { "description": "a request to create a pacticipant", "request": { "method": "post", "path": "/pacticipants", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json" }, "body": { "name": "Foo", "repositoryUrl": "http://foo" } }, "response": { "status": 201, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "name": "Foo", "repositoryUrl": "http://foo", "_links": { "self": { "href": "http://localhost:1234/pacticipants/Foo" } } }, "matchingRules": { "$.body._links.self.href": { "match": "regex", "regex": "http:\\/\\/.*" } } } }, { "description": "a request to retrieve a pacticipant", "providerState": "a pacticipant with name Foo exists", "request": { "method": "get", "path": "/pacticipants/Foo", "headers": { "Accept": "application/hal+json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "self": { "href": "http://localhost:1234/pacticipants/Foo" } } }, "matchingRules": { "$.body._links.self.href": { "match": "regex", "regex": "http:\\/\\/.*" } } } }, { "description": "a request to update a pacticipant", "providerState": "a pacticipant with name Foo exists", "request": { "method": "patch", "path": "/pacticipants/Foo", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json" }, "body": { "name": "Foo", "repositoryUrl": "http://foo" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "name": "Foo", "repositoryUrl": "http://foo", "_links": { "self": { "href": "http://localhost:1234/pacticipants/Foo" } } }, "matchingRules": { "$.body._links.self.href": { "match": "regex", "regex": "http:\\/\\/.*" } } } }, { "description": "a request for the index resource", "providerState": "the pb:publish-contracts relations exists in the index resource", "request": { "method": "GET", "path": "/", "headers": { "Accept": "application/hal+json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "pb:publish-contracts": { "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-PUBLISH-CONTRACTS" } } }, "matchingRules": { "$.body._links.pb:publish-contracts.href": { "match": "regex", "regex": "http:\\/\\/.*" } } } }, { "description": "a request to publish contracts", "request": { "method": "POST", "path": "/HAL-REL-PLACEHOLDER-PB-PUBLISH-CONTRACTS", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json" }, "body": { "pacticipantName": "Foo", "pacticipantVersionNumber": "5556b8149bf8bac76bc30f50a8a2dd4c22c85f30", "branch": "main", "tags": [ "dev" ], "buildUrl": "http://build", "contracts": [ { "consumerName": "Foo", "providerName": "Bar", "specification": "pact", "contentType": "application/json", "content": "eyJjb25zdW1lciI6eyJuYW1lIjoiRm9vIn0sInByb3ZpZGVyIjp7Im5hbWUiOiJCYXIifSwiaW50ZXJhY3Rpb25zIjpbeyJkZXNjcmlwdGlvbiI6ImFuIGV4YW1wbGUgcmVxdWVzdCIsInByb3ZpZGVyU3RhdGUiOiJhIHByb3ZpZGVyIHN0YXRlIiwicmVxdWVzdCI6eyJtZXRob2QiOiJHRVQiLCJwYXRoIjoiLyIsImhlYWRlcnMiOnt9fSwicmVzcG9uc2UiOnsic3RhdHVzIjoyMDAsImhlYWRlcnMiOnsiQ29udGVudC1UeXBlIjoiYXBwbGljYXRpb24vaGFsK2pzb24ifX19XSwibWV0YWRhdGEiOnsicGFjdFNwZWNpZmljYXRpb24iOnsidmVyc2lvbiI6IjIuMC4wIn19fQ==", "onConflict": "merge" } ] } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_embedded": { "pacticipant": { "name": "Foo" }, "version": { "number": "5556b8149bf8bac76bc30f50a8a2dd4c22c85f30", "buildUrl": "http://build" } }, "logs": [ { "level": "info", "message": "some message" } ], "_links": { "pb:pacticipant-version-tags": [ { "name": "dev" } ], "pb:contracts": [ { "href": "http://some-pact" } ] } }, "matchingRules": { "$.body.logs": { "min": 1 }, "$.body.logs[*].*": { "match": "type" }, "$.body._links.pb:contracts[0].href": { "match": "type" } } } }, { "description": "a request for the index resource", "providerState": "the pb:pacticipant-version and pb:environments relations exist in the index resource", "request": { "method": "GET", "path": "/", "headers": { "Accept": "application/hal+json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "pb:pacticipant-version": { "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-{pacticipant}-{version}" }, "pb:environments": { "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-ENVIRONMENTS" } } }, "matchingRules": { "$.body._links.pb:pacticipant-version.href": { "match": "regex", "regex": "http:\\/\\/.*{pacticipant}.*{version}" }, "$.body._links.pb:environments.href": { "match": "regex", "regex": "http:\\/\\/.*" } } } }, { "description": "a request for a pacticipant version", "providerState": "version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for deployment", "request": { "method": "GET", "path": "/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-Foo-5556b8149bf8bac76bc30f50a8a2dd4c22c85f30", "headers": { "Accept": "application/hal+json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "pb:record-deployment": [ { "name": "test", "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-RECORD-DEPLOYMENT-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST" } ] } }, "matchingRules": { "$.body._links.pb:record-deployment[0].href": { "match": "regex", "regex": "http:\\/\\/.*" } } } }, { "description": "a request to record a deployment", "providerState": "version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for deployment", "request": { "method": "POST", "path": "/HAL-REL-PLACEHOLDER-PB-RECORD-DEPLOYMENT-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json" }, "body": { "target": "blue" } }, "response": { "status": 201, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "target": "blue" } } }, { "description": "a request for a pacticipant version", "providerState": "version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with 2 environments that aren't test available for deployment", "request": { "method": "GET", "path": "/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-Foo-5556b8149bf8bac76bc30f50a8a2dd4c22c85f30", "headers": { "Accept": "application/hal+json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "pb:record-deployment": [ { "name": "prod", "href": "href" }, { "name": "dev", "href": "href" } ] } }, "matchingRules": { "$.body._links.pb:record-deployment[0]": { "match": "type" }, "$.body._links.pb:record-deployment[1]": { "match": "type" } } } }, { "description": "a request for the environments", "providerState": "an environment with name test exists", "request": { "method": "GET", "path": "/HAL-REL-PLACEHOLDER-PB-ENVIRONMENTS", "headers": { "Accept": "application/hal+json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "pb:environments": [ { "name": "test", "href": "href" } ] } }, "matchingRules": { "$.body._links.pb:environments[0].href": { "match": "type" } } } }, { "description": "a request for a pacticipant version", "providerState": "version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for release", "request": { "method": "GET", "path": "/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-Foo-5556b8149bf8bac76bc30f50a8a2dd4c22c85f30", "headers": { "Accept": "application/hal+json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "pb:record-release": [ { "name": "test", "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-RECORD-RELEASE-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST" } ] } }, "matchingRules": { "$.body._links.pb:record-release[0].href": { "match": "regex", "regex": "http:\\/\\/.*" } } } }, { "description": "a request to record a release", "providerState": "version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for deployment", "request": { "method": "POST", "path": "/HAL-REL-PLACEHOLDER-PB-RECORD-RELEASE-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json" } }, "response": { "status": 201, "headers": { "Content-Type": "application/hal+json;charset=utf-8" } } }, { "description": "a request for an environment", "providerState": "an environment with name test and UUID 16926ef3-590f-4e3f-838e-719717aa88c9 exists", "request": { "method": "GET", "path": "/HAL-REL-PLACEHOLDER-PB-ENVIRONMENT-16926ef3-590f-4e3f-838e-719717aa88c9", "headers": { "Accept": "application/hal+json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "pb:currently-deployed-deployed-versions": { "href": "http://localhost:1234/PLACEHOLDER-ENVIRONMENT-CURRENTLY-DEPLOYED-16926ef3-590f-4e3f-838e-719717aa88c9" } } }, "matchingRules": { "$.body._links.pb:currently-deployed-deployed-versions.href": { "match": "regex", "regex": "^http.*" } } } }, { "description": "a request to list the versions deployed to an environment for a pacticipant name and target", "providerState": "an version is deployed to environment with UUID 16926ef3-590f-4e3f-838e-719717aa88c9 with target customer-1", "request": { "method": "GET", "path": "/PLACEHOLDER-ENVIRONMENT-CURRENTLY-DEPLOYED-16926ef3-590f-4e3f-838e-719717aa88c9", "query": "pacticipant=Foo", "headers": { "Accept": "application/hal+json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_embedded": { "deployedVersions": [ { "target": "customer-1", "_links": { "self": { "href": "http://localhost:1234/PLACEHOLDER-DEPLOYED-VERSION-ff3adecf-cfc5-4653-a4e3-f1861092f8e0" } } } ] } }, "matchingRules": { "$.body._embedded.deployedVersions[0]._links.self.href": { "match": "regex", "regex": "^http" } } } }, { "description": "a request to mark a deployed version as not currently deploye", "providerState": "a currently deployed version exists", "request": { "method": "PATCH", "path": "/PLACEHOLDER-DEPLOYED-VERSION-ff3adecf-cfc5-4653-a4e3-f1861092f8e0", "headers": { "Content-Type": "application/merge-patch+json" }, "body": { "currentlyDeployed": false } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "currentlyDeployed": false, "_embedded": { "version": { "number": "2" } } }, "matchingRules": { "$.body._embedded.version.number": { "match": "type" } } } }, { "description": "a request to create a webhook with a JSON body for a consumer and provider", "providerState": "the 'Pricing Service' and 'Condor' already exist in the pact-broker", "request": { "method": "post", "path": "/webhooks/provider/Pricing%20Service/consumer/Condor", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json" }, "body": { "description": "a webhook", "events": [ { "name": "contract_content_changed" } ], "request": { "url": "https://webhook", "method": "POST", "headers": { "Foo": "bar", "Bar": "foo" }, "body": { "some": "body" }, "username": "username", "password": "password" } } }, "response": { "status": 201, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "description": "a webhook", "_links": { "self": { "href": "http://localhost:1234/some-url", "title": "A title" } } }, "matchingRules": { "$.body.description": { "match": "type" }, "$.body._links.self.href": { "match": "regex", "regex": "http:\\/\\/.*" }, "$.body._links.self.title": { "match": "type" } } } }, { "description": "a request to create a webhook with every possible event type", "providerState": "the 'Pricing Service' and 'Condor' already exist in the pact-broker", "request": { "method": "post", "path": "/webhooks/provider/Pricing%20Service/consumer/Condor", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json" }, "body": { "description": "a webhook", "events": [ { "name": "contract_content_changed" }, { "name": "contract_published" }, { "name": "provider_verification_published" }, { "name": "provider_verification_succeeded" }, { "name": "provider_verification_failed" } ], "request": { "url": "https://webhook", "method": "POST", "headers": { "Foo": "bar", "Bar": "foo" }, "body": { "some": "body" }, "username": "username", "password": "password" } } }, "response": { "status": 201, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "description": "a webhook", "_links": { "self": { "href": "http://localhost:1234/some-url", "title": "A title" } } }, "matchingRules": { "$.body.description": { "match": "type" }, "$.body._links.self.href": { "match": "regex", "regex": "http:\\/\\/.*" }, "$.body._links.self.title": { "match": "type" } } } }, { "description": "a request to create a webhook with a non-JSON body for a consumer and provider", "providerState": "the 'Pricing Service' and 'Condor' already exist in the pact-broker", "request": { "method": "post", "path": "/webhooks/provider/Pricing%20Service/consumer/Condor", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json" }, "body": { "description": "a webhook", "events": [ { "name": "contract_content_changed" } ], "request": { "url": "https://webhook", "method": "POST", "headers": { "Foo": "bar", "Bar": "foo" }, "body": "", "username": "username", "password": "password" } } }, "response": { "status": 201, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "description": "a webhook", "_links": { "self": { "href": "http://localhost:1234/some-url", "title": "A title" } } }, "matchingRules": { "$.body.description": { "match": "type" }, "$.body._links.self.href": { "match": "regex", "regex": "http:\\/\\/.*" }, "$.body._links.self.title": { "match": "type" } } } }, { "description": "an invalid request to create a webhook for a consumer and provider", "providerState": "the 'Pricing Service' and 'Condor' already exist in the pact-broker", "request": { "method": "post", "path": "/webhooks/provider/Pricing%20Service/consumer/Condor", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json" }, "body": { "description": "a webhook", "events": [ { "name": "contract_content_changed" } ], "request": { "method": "POST", "headers": { "Foo": "bar", "Bar": "foo" }, "body": { "some": "body" }, "username": "username", "password": "password" } } }, "response": { "status": 400, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "errors": { "request.url": [ "Some error" ] } }, "matchingRules": { "$.body.errors['request.url']": { "min": 1 }, "$.body.errors['request.url'][*].*": { "match": "type" } } } }, { "description": "a request to create a webhook for a consumer and provider", "providerState": "'Condor' does not exist in the pact-broker", "request": { "method": "post", "path": "/webhooks/provider/Pricing%20Service/consumer/Condor", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json" }, "body": { "description": "a webhook", "events": [ { "name": "contract_content_changed" } ], "request": { "url": "https://webhook", "method": "POST", "headers": { "Foo": "bar", "Bar": "foo" }, "body": { "some": "body" }, "username": "username", "password": "password" } } }, "response": { "status": 404, "headers": { "Content-Type": "application/hal+json;charset=utf-8" } } }, { "description": "a request for the index resource", "request": { "method": "get", "path": "/", "headers": { "Accept": "application/hal+json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "pb:webhooks": { "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-WEBHOOKS" }, "pb:pacticipants": { "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-PACTICIPANTS" }, "pb:pacticipant": { "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-{pacticipant}" } } }, "matchingRules": { "$.body._links.pb:webhooks.href": { "match": "regex", "regex": "http:\\/\\/.*" }, "$.body._links.pb:pacticipants.href": { "match": "regex", "regex": "http:\\/\\/.*" }, "$.body._links.pb:pacticipant.href": { "match": "regex", "regex": "http:\\/\\/.*{pacticipant}" } } } }, { "description": "a request to create a webhook with a JSON body for a consumer", "providerState": "the 'Pricing Service' and 'Condor' already exist in the pact-broker", "request": { "method": "post", "path": "/HAL-REL-PLACEHOLDER-PB-WEBHOOKS", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json" }, "body": { "description": "a webhook", "events": [ { "name": "contract_content_changed" } ], "request": { "url": "https://webhook", "method": "POST", "headers": { "Foo": "bar", "Bar": "foo" }, "body": { "some": "body" }, "username": "username", "password": "password" }, "consumer": { "name": "Condor" } } }, "response": { "status": 201, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "description": "a webhook", "_links": { "self": { "href": "http://localhost:1234/some-url", "title": "A title" } } }, "matchingRules": { "$.body.description": { "match": "type" }, "$.body._links.self.href": { "match": "regex", "regex": "http:\\/\\/.*" }, "$.body._links.self.title": { "match": "type" } } } }, { "description": "a request to create a webhook with a JSON body for a consumer that does not exist", "request": { "method": "post", "path": "/HAL-REL-PLACEHOLDER-PB-WEBHOOKS", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json" }, "body": { "description": "a webhook", "events": [ { "name": "contract_content_changed" } ], "request": { "url": "https://webhook", "method": "POST", "headers": { "Foo": "bar", "Bar": "foo" }, "body": { "some": "body" }, "username": "username", "password": "password" }, "consumer": { "name": "Condor" } } }, "response": { "status": 400, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "errors": { "consumer.name": [ "Some error" ] } }, "matchingRules": { "$.body.errors['consumer.name']": { "min": 1 }, "$.body.errors['consumer.name'][*].*": { "match": "type" } } } }, { "description": "a request to create a webhook with a JSON body for a provider", "providerState": "the 'Pricing Service' and 'Condor' already exist in the pact-broker", "request": { "method": "post", "path": "/HAL-REL-PLACEHOLDER-PB-WEBHOOKS", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json" }, "body": { "description": "a webhook", "events": [ { "name": "contract_content_changed" } ], "request": { "url": "https://webhook", "method": "POST", "headers": { "Foo": "bar", "Bar": "foo" }, "body": { "some": "body" }, "username": "username", "password": "password" }, "provider": { "name": "Pricing Service" } } }, "response": { "status": 201, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "description": "a webhook", "_links": { "self": { "href": "http://localhost:1234/some-url", "title": "A title" } } }, "matchingRules": { "$.body.description": { "match": "type" }, "$.body._links.self.href": { "match": "regex", "regex": "http:\\/\\/.*" }, "$.body._links.self.title": { "match": "type" } } } }, { "description": "a request to create a global webhook with a JSON body", "request": { "method": "post", "path": "/HAL-REL-PLACEHOLDER-PB-WEBHOOKS", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json" }, "body": { "description": "a webhook", "events": [ { "name": "contract_content_changed" } ], "request": { "url": "https://webhook", "method": "POST", "headers": { "Foo": "bar", "Bar": "foo" }, "body": { "some": "body" }, "username": "username", "password": "password" } } }, "response": { "status": 201, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "description": "a webhook", "_links": { "self": { "href": "http://localhost:1234/some-url", "title": "A title" } } }, "matchingRules": { "$.body.description": { "match": "type" }, "$.body._links.self.href": { "match": "regex", "regex": "http:\\/\\/.*" }, "$.body._links.self.title": { "match": "type" } } } }, { "description": "a request for the index resource with the webhook relation", "request": { "method": "get", "path": "/", "headers": { "Accept": "application/hal+json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "_links": { "pb:webhook": { "href": "http://localhost:1234/webhooks/{uuid}", "templated": true } } }, "matchingRules": { "$.body._links.pb:webhook.href": { "match": "regex", "regex": "http:\\/\\/.*\\/webhooks\\/{uuid}" } } } }, { "description": "a request to create a webhook with a JSON body and a uuid", "providerState": "the 'Pricing Service' and 'Condor' already exist in the pact-broker", "request": { "method": "put", "path": "/webhooks/696c5f93-1b7f-44bc-8d03-59440fcaa9a0", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json" }, "body": { "description": "a webhook", "events": [ { "name": "contract_content_changed" } ], "request": { "url": "https://webhook", "method": "POST", "headers": { "Foo": "bar", "Bar": "foo" }, "body": { "some": "body" }, "username": "username", "password": "password" }, "provider": { "name": "Pricing Service" }, "consumer": { "name": "Condor" } } }, "response": { "status": 201, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "description": "a webhook", "_links": { "self": { "href": "http://localhost:1234/some-url", "title": "A title" } } }, "matchingRules": { "$.body.description": { "match": "type" }, "$.body._links.self.href": { "match": "regex", "regex": "http:\\/\\/.*" }, "$.body._links.self.title": { "match": "type" } } } }, { "description": "a request to update a webhook", "providerState": "a webhook with the uuid 696c5f93-1b7f-44bc-8d03-59440fcaa9a0 exists", "request": { "method": "put", "path": "/webhooks/696c5f93-1b7f-44bc-8d03-59440fcaa9a0", "headers": { "Content-Type": "application/json", "Accept": "application/hal+json" }, "body": { "description": "a webhook", "events": [ { "name": "contract_content_changed" } ], "request": { "url": "https://webhook", "method": "POST", "headers": { "Foo": "bar", "Bar": "foo" }, "body": { "some": "body" }, "username": "username", "password": "password" }, "provider": { "name": "Pricing Service" }, "consumer": { "name": "Condor" } } }, "response": { "status": 200, "headers": { "Content-Type": "application/hal+json;charset=utf-8" }, "body": { "description": "a webhook", "_links": { "self": { "href": "http://localhost:1234/some-url", "title": "A title" } } }, "matchingRules": { "$.body.description": { "match": "type" }, "$.body._links.self.href": { "match": "regex", "regex": "http:\\/\\/.*" }, "$.body._links.self.title": { "match": "type" } } } } ], "metadata": { "pactSpecification": { "version": "2.0.0" } } }