-
-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge compatibility suite commit 'c83dd5d2971131c897cfab511a8c502d0b5…
…06961'
- Loading branch information
Showing
3 changed files
with
224 additions
and
5 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
compatibility-suite/pact-compatibility-suite/features/V1/HTTP/http_consumer.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
@consumer | ||
Feature: Basic HTTP consumer | ||
Supports basic HTTP consumer interactions | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
210 changes: 210 additions & 0 deletions
210
compatibility-suite/pact-compatibility-suite/fixtures/pact-broker.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,210 @@ | ||
{ | ||
"consumer": { | ||
"name": "Pact Compatability Suite Broker Client" | ||
}, | ||
"interactions": [ | ||
{ | ||
"description": "a request for the provider pacts", | ||
"pending": false, | ||
"request": { | ||
"body": { | ||
"content": { | ||
"consumerVersionSelectors": [], | ||
"includePendingStatus": false | ||
}, | ||
"contentType": "application/json", | ||
"encoded": false | ||
}, | ||
"headers": { | ||
"Content-Type": [ | ||
"application/json" | ||
] | ||
}, | ||
"method": "POST", | ||
"path": "/pacts/provider/p/for-verification" | ||
}, | ||
"response": { | ||
"body": { | ||
"content": { | ||
"_embedded": { | ||
"pacts": [ | ||
{ | ||
"_links": { | ||
"self": { | ||
"href": "http://localhost:9876/pacts/provider/p/consumer/c_1", | ||
"name": "Pact between c_1 and p" | ||
} | ||
}, | ||
"shortDescription": "latest" | ||
} | ||
] | ||
}, | ||
"_links": { | ||
"self": { | ||
"href": "http://localhost:9876/pacts/provider/{provider}/for-verification", | ||
"title": "Pacts to be verified" | ||
} | ||
} | ||
}, | ||
"contentType": "application/json", | ||
"encoded": false | ||
}, | ||
"headers": { | ||
"Content-Type": [ | ||
"application/json" | ||
] | ||
}, | ||
"matchingRules": { | ||
"body": { | ||
"$._embedded.pacts[*]._links.self.href": { | ||
"combine": "AND", | ||
"matchers": [ | ||
{ | ||
"match": "regex", | ||
"regex": ".*\\/(pacts\\/provider\\/p\\/consumer\\/c_1)$" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"generators": { | ||
"body": { | ||
"$._embedded.pacts[*]._links.self.href": { | ||
"type": "MockServerURL", | ||
"example": "http://localhost:9876/pacts/provider/p/consumer/c_1", | ||
"regex": ".*\\/(pacts\\/provider\\/p\\/consumer\\/c_1)$" | ||
} | ||
} | ||
}, | ||
"status": 200 | ||
}, | ||
"transport": "https", | ||
"type": "Synchronous/HTTP" | ||
}, | ||
{ | ||
"description": "a request to the root", | ||
"pending": false, | ||
"request": { | ||
"method": "GET", | ||
"path": "/" | ||
}, | ||
"response": { | ||
"body": { | ||
"content": { | ||
"_links": { | ||
"pb:provider-pacts-for-verification": { | ||
"href": "http://localhost:9876/pacts/provider/{provider}/for-verification", | ||
"templated": true, | ||
"title": "Pact versions to be verified for the specified provider" | ||
} | ||
} | ||
}, | ||
"contentType": "application/json", | ||
"encoded": false | ||
}, | ||
"headers": { | ||
"Content-Type": [ | ||
"application/json" | ||
] | ||
}, | ||
"matchingRules": { | ||
"body": { | ||
"$._links.pb:provider-pacts-for-verification.href": { | ||
"combine": "AND", | ||
"matchers": [ | ||
{ | ||
"match": "regex", | ||
"regex": ".*\\/(\\Qpacts\\E\\/\\Qprovider\\E\\/\\Q{provider}\\E\\/\\Qfor-verification\\E)$" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"generators": { | ||
"body": { | ||
"$._links.pb:provider-pacts-for-verification.href": { | ||
"type": "MockServerURL", | ||
"example": "http://localhost:9876/pacts/provider/{provider}/for-verification", | ||
"regex": ".*\\/(\\Qpacts\\E\\/\\Qprovider\\E\\/\\Q{provider}\\E\\/\\Qfor-verification\\E)$" | ||
} | ||
} | ||
}, | ||
"status": 200 | ||
}, | ||
"transport": "https", | ||
"type": "Synchronous/HTTP" | ||
}, | ||
{ | ||
"description": "publish verification results for c_1", | ||
"pending": false, | ||
"request": { | ||
"method": "POST", | ||
"path": "/pacts/provider/p/consumer/c_1/verification-results", | ||
"headers": { | ||
"Content-Type": ["application\/json; charset=UTF-8"] | ||
}, | ||
"body": { | ||
"content": { | ||
"providerApplicationVersion": "0.0.0", | ||
"success": true, | ||
"verifiedBy":{ | ||
"implementation": "Pact-JVM", | ||
"version": "4.5.7" | ||
} | ||
}, | ||
"contentType": "application/json", | ||
"encoded": false | ||
}, | ||
"matchingRules": { | ||
"body": { | ||
"$.providerApplicationVersion": { | ||
"combine": "AND", | ||
"matchers": [ | ||
{ | ||
"match": "type" | ||
} | ||
] | ||
}, | ||
"$.success": { | ||
"combine": "AND", | ||
"matchers": [ | ||
{ | ||
"match": "boolean" | ||
} | ||
] | ||
}, | ||
"$.verifiedBy.implementation": { | ||
"combine": "AND", | ||
"matchers": [ | ||
{ | ||
"match": "type" | ||
} | ||
] | ||
}, | ||
"$.verifiedBy.version": { | ||
"combine": "AND", | ||
"matchers": [ | ||
{ | ||
"match": "semver" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"response": { | ||
"status": 201 | ||
}, | ||
"transport": "https", | ||
"type": "Synchronous/HTTP" | ||
} | ||
], | ||
"metadata": { | ||
"pactSpecification": { | ||
"version": "4.0" | ||
} | ||
}, | ||
"provider": { | ||
"name": "Pact Broker" | ||
} | ||
} |