pact_broker-client 1.13.1 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/CHANGELOG.md +17 -0
- data/README.md +28 -17
- data/doc/markdown/Pact Broker Client - Pact Broker.md +582 -0
- data/doc/markdown/README.md +3 -0
- data/doc/pacts/markdown/Pact Broker Client - Pact Broker.md +1174 -0
- data/doc/pacts/markdown/README.md +3 -0
- data/example/scripts/README.md +13 -0
- data/example/scripts/deploy-consumer.sh +26 -0
- data/example/scripts/pact.json +67 -0
- data/example/scripts/publish-pact.sh +3 -0
- data/example/scripts/publish-verification.sh +3 -0
- data/example/scripts/verification.json +4 -0
- data/lib/pact_broker/client/base_client.rb +17 -1
- data/lib/pact_broker/client/cli/broker.rb +27 -0
- data/lib/pact_broker/client/cli/can_i_deploy_long_desc.txt +13 -3
- data/lib/pact_broker/client/error.rb +2 -0
- data/lib/pact_broker/client/matrix.rb +0 -2
- data/lib/pact_broker/client/version.rb +1 -1
- data/lib/pact_broker/client/versions.rb +15 -5
- data/lib/pact_broker/client/versions/describe.rb +60 -0
- data/lib/pact_broker/client/versions/formatter.rb +20 -0
- data/lib/pact_broker/client/versions/json_formatter.rb +13 -0
- data/lib/pact_broker/client/versions/text_formatter.rb +31 -0
- data/spec/integration/can_i_deploy_spec.rb +2 -2
- data/spec/integration/create_version_tag_spec.rb +1 -1
- data/spec/lib/pact_broker/client/base_client_spec.rb +28 -0
- data/spec/lib/pact_broker/client/versions/describe_spec.rb +65 -0
- data/spec/pacts/pact_broker_client-pact_broker.json +118 -0
- data/spec/service_providers/pact_broker_client_versions_spec.rb +114 -0
- data/spec/service_providers/pact_helper.rb +1 -0
- metadata +19 -3
@@ -0,0 +1,1174 @@
|
|
1
|
+
### A pact between Pact Broker Client and Pact Broker
|
2
|
+
|
3
|
+
#### Requests from Pact Broker Client to Pact Broker
|
4
|
+
|
5
|
+
* [A request for the compatibility matrix for a pacticipant that does not exist](#a_request_for_the_compatibility_matrix_for_a_pacticipant_that_does_not_exist)
|
6
|
+
|
7
|
+
* [A request for the compatibility matrix for all versions of Foo and Bar](#a_request_for_the_compatibility_matrix_for_all_versions_of_Foo_and_Bar_given_the_pact_for_Foo_version_1.2.3_and_1.2.4_has_been_verified_by_Bar_version_4.5.6) given the pact for Foo version 1.2.3 and 1.2.4 has been verified by Bar version 4.5.6
|
8
|
+
|
9
|
+
* [A request for the compatibility matrix for Foo version 1.2.3 and Bar version 4.5.6](#a_request_for_the_compatibility_matrix_for_Foo_version_1.2.3_and_Bar_version_4.5.6_given_the_pact_for_Foo_Thing_version_1.2.3_has_been_verified_by_Bar_version_4.5.6) given the pact for Foo Thing version 1.2.3 has been verified by Bar version 4.5.6
|
10
|
+
|
11
|
+
* [A request for the compatibility matrix for Foo version 1.2.3 and Bar version 4.5.6](#a_request_for_the_compatibility_matrix_for_Foo_version_1.2.3_and_Bar_version_4.5.6_given_the_pact_for_Foo_version_1.2.3_has_been_verified_by_Bar_version_4.5.6) given the pact for Foo version 1.2.3 has been verified by Bar version 4.5.6
|
12
|
+
|
13
|
+
* [A request for the compatibility matrix for Foo version 1.2.3 and the latest prod version of Bar](#a_request_for_the_compatibility_matrix_for_Foo_version_1.2.3_and_the_latest_prod_version_of_Bar_given_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) given 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
|
14
|
+
|
15
|
+
* [A request for the compatibility matrix for Foo version 1.2.3 and the latest prod versions of all other pacticipants](#a_request_for_the_compatibility_matrix_for_Foo_version_1.2.3_and_the_latest_prod_versions_of_all_other_pacticipants_given_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) given 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
|
16
|
+
|
17
|
+
* [A request for the compatibility matrix for Foo version 1.2.3 and the latest version of Bar](#a_request_for_the_compatibility_matrix_for_Foo_version_1.2.3_and_the_latest_version_of_Bar_given_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) given 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
|
18
|
+
|
19
|
+
* [A request for the compatibility matrix where one or more versions does not exist](#a_request_for_the_compatibility_matrix_where_one_or_more_versions_does_not_exist_given_the_pact_for_Foo_version_1.2.3_has_been_verified_by_Bar_version_4.5.6) given the pact for Foo version 1.2.3 has been verified by Bar version 4.5.6
|
20
|
+
|
21
|
+
* [A request for the compatibility matrix where only the version of Foo is specified](#a_request_for_the_compatibility_matrix_where_only_the_version_of_Foo_is_specified_given_the_pact_for_Foo_version_1.2.3_has_been_verified_by_Bar_version_4.5.6_and_version_5.6.7) given the pact for Foo version 1.2.3 has been verified by Bar version 4.5.6 and version 5.6.7
|
22
|
+
|
23
|
+
* [A request for the index resource](#a_request_for_the_index_resource_given_the_pb:latest-tagged-version_relation_exists_in_the_index_resource) given the pb:latest-tagged-version relation exists in the index resource
|
24
|
+
|
25
|
+
* [A request for the index resource](#a_request_for_the_index_resource_given_the_pb:latest-version_relation_exists_in_the_index_resource) given the pb:latest-version relation exists in the index resource
|
26
|
+
|
27
|
+
* [A request for the list of the latest pacts from all consumers for the Pricing Service'](#a_request_for_the_list_of_the_latest_pacts_from_all_consumers_for_the_Pricing_Service'_given_a_latest_pact_between_Condor_and_the_Pricing_Service_exists) given a latest pact between Condor and the Pricing Service exists
|
28
|
+
|
29
|
+
* [A request for the list of the latest prod pacts from all consumers for the Pricing Service'](#a_request_for_the_list_of_the_latest_prod_pacts_from_all_consumers_for_the_Pricing_Service'_given_tagged_as_prod_pact_between_Condor_and_the_Pricing_Service_exists) given tagged as prod pact between Condor and the Pricing Service exists
|
30
|
+
|
31
|
+
* [A request for the successful rows of the compatibility matrix for all versions of Foo and Bar](#a_request_for_the_successful_rows_of_the_compatibility_matrix_for_all_versions_of_Foo_and_Bar_given_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) given 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
|
32
|
+
|
33
|
+
* [A request retrieve a pact for a specific version](#a_request_retrieve_a_pact_for_a_specific_version_given_the_'Pricing_Service'_and_'Condor'_already_exist_in_the_pact-broker,_and_Condor_already_has_a_pact_published_for_version_1.3.0) given the 'Pricing Service' and 'Condor' already exist in the pact-broker, and Condor already has a pact published for version 1.3.0
|
34
|
+
|
35
|
+
* [A request to get the Pricing Service](#a_request_to_get_the_Pricing_Service_given_the_'Pricing_Service'_already_exists_in_the_pact-broker) given the 'Pricing Service' already exists in the pact-broker
|
36
|
+
|
37
|
+
* [A request to get the Pricing Service](#a_request_to_get_the_Pricing_Service_given_the_'Pricing_Service'_does_not_exist_in_the_pact-broker) given the 'Pricing Service' does not exist in the pact-broker
|
38
|
+
|
39
|
+
* [A request to list pacticipants](#a_request_to_list_pacticipants_given_'Condor'_exists_in_the_pact-broker) given 'Condor' exists in the pact-broker
|
40
|
+
|
41
|
+
* [A request to list the latest pacts](#a_request_to_list_the_latest_pacts_given_a_pact_between_Condor_and_the_Pricing_Service_exists) given a pact between Condor and the Pricing Service exists
|
42
|
+
|
43
|
+
* [A request to publish a pact](#a_request_to_publish_a_pact_given_'Condor'_already_exist_in_the_pact-broker,_but_the_'Pricing_Service'_does_not) given 'Condor' already exist in the pact-broker, but the 'Pricing Service' does not
|
44
|
+
|
45
|
+
* [A request to publish a pact](#a_request_to_publish_a_pact_given_the_'Pricing_Service'_already_exists_in_the_pact-broker) given the 'Pricing Service' already exists in the pact-broker
|
46
|
+
|
47
|
+
* [A request to publish a pact](#a_request_to_publish_a_pact_given_an_error_occurs_while_publishing_a_pact) given an error occurs while publishing a pact
|
48
|
+
|
49
|
+
* [A request to publish a pact with method patch](#a_request_to_publish_a_pact_with_method_patch_given_the_'Pricing_Service'_and_'Condor'_already_exist_in_the_pact-broker,_and_Condor_already_has_a_pact_published_for_version_1.3.0) given the 'Pricing Service' and 'Condor' already exist in the pact-broker, and Condor already has a pact published for version 1.3.0
|
50
|
+
|
51
|
+
* [A request to publish a pact with method put](#a_request_to_publish_a_pact_with_method_put_given_the_'Pricing_Service'_and_'Condor'_already_exist_in_the_pact-broker,_and_Condor_already_has_a_pact_published_for_version_1.3.0) given the 'Pricing Service' and 'Condor' already exist in the pact-broker, and Condor already has a pact published for version 1.3.0
|
52
|
+
|
53
|
+
* [A request to register the repository URL of a pacticipant](#a_request_to_register_the_repository_URL_of_a_pacticipant_given_the_'Pricing_Service'_already_exists_in_the_pact-broker) given the 'Pricing Service' already exists in the pact-broker
|
54
|
+
|
55
|
+
* [A request to register the repository URL of a pacticipant](#a_request_to_register_the_repository_URL_of_a_pacticipant_given_the_'Pricing_Service'_does_not_exist_in_the_pact-broker) given the 'Pricing Service' does not exist in the pact-broker
|
56
|
+
|
57
|
+
* [A request to retrieve the latest 'production' version of Condor](#a_request_to_retrieve_the_latest_'production'_version_of_Condor_given_'Condor'_exists_in_the_pact-broker_with_the_latest_tagged_'production'_version_1.2.3) given 'Condor' exists in the pact-broker with the latest tagged 'production' version 1.2.3
|
58
|
+
|
59
|
+
* [A request to retrieve the latest pact between Condor and the Pricing Service](#a_request_to_retrieve_the_latest_pact_between_Condor_and_the_Pricing_Service_given_a_pact_between_Condor_and_the_Pricing_Service_exists) given a pact between Condor and the Pricing Service exists
|
60
|
+
|
61
|
+
* [A request to retrieve the latest pact between Condor and the Pricing Service](#a_request_to_retrieve_the_latest_pact_between_Condor_and_the_Pricing_Service_given_no_pact_between_Condor_and_the_Pricing_Service_exists) given no pact between Condor and the Pricing Service exists
|
62
|
+
|
63
|
+
* [A request to retrieve the latest version of Condor](#a_request_to_retrieve_the_latest_version_of_Condor_given_'Condor'_exists_in_the_pact-broker_with_the_latest_version_1.2.3) given 'Condor' exists in the pact-broker with the latest version 1.2.3
|
64
|
+
|
65
|
+
* [A request to retrieve the pact between the production verison of Condor and the Pricing Service](#a_request_to_retrieve_the_pact_between_the_production_verison_of_Condor_and_the_Pricing_Service_given_a_pact_between_Condor_and_the_Pricing_Service_exists_for_the_production_version_of_Condor) given a pact between Condor and the Pricing Service exists for the production version of Condor
|
66
|
+
|
67
|
+
* [A request to tag the production version of Condor](#a_request_to_tag_the_production_version_of_Condor_given_'Condor'_exists_in_the_pact-broker_with_version_1.3.0,_tagged_with_'prod') given 'Condor' exists in the pact-broker with version 1.3.0, tagged with 'prod'
|
68
|
+
|
69
|
+
* [A request to tag the production version of Condor](#a_request_to_tag_the_production_version_of_Condor_given_'Condor'_does_not_exist_in_the_pact-broker) given 'Condor' does not exist in the pact-broker
|
70
|
+
|
71
|
+
* [A request to tag the production version of Condor](#a_request_to_tag_the_production_version_of_Condor_given_'Condor'_exists_in_the_pact-broker) given 'Condor' exists in the pact-broker
|
72
|
+
|
73
|
+
#### Interactions
|
74
|
+
|
75
|
+
<a name="a_request_for_the_compatibility_matrix_for_a_pacticipant_that_does_not_exist"></a>
|
76
|
+
Upon receiving **a request for the compatibility matrix for a pacticipant that does not exist** from Pact Broker Client, with
|
77
|
+
```json
|
78
|
+
{
|
79
|
+
"method": "get",
|
80
|
+
"path": "/matrix",
|
81
|
+
"query": "q[][pacticipant]=Wiffle&q[][version]=1.2.3&q[][pacticipant]=Meep&q[][version]=9.9.9&latestby=cvpv"
|
82
|
+
}
|
83
|
+
```
|
84
|
+
Pact Broker will respond with:
|
85
|
+
```json
|
86
|
+
{
|
87
|
+
"status": 400,
|
88
|
+
"body": {
|
89
|
+
"errors": [
|
90
|
+
"an error message"
|
91
|
+
]
|
92
|
+
}
|
93
|
+
}
|
94
|
+
```
|
95
|
+
<a name="a_request_for_the_compatibility_matrix_for_all_versions_of_Foo_and_Bar_given_the_pact_for_Foo_version_1.2.3_and_1.2.4_has_been_verified_by_Bar_version_4.5.6"></a>
|
96
|
+
Given **the pact for Foo version 1.2.3 and 1.2.4 has been verified by Bar version 4.5.6**, upon receiving **a request for the compatibility matrix for all versions of Foo and Bar** from Pact Broker Client, with
|
97
|
+
```json
|
98
|
+
{
|
99
|
+
"method": "get",
|
100
|
+
"path": "/matrix",
|
101
|
+
"query": "q[][pacticipant]=Foo&q[][pacticipant]=Bar&latestby=cvpv"
|
102
|
+
}
|
103
|
+
```
|
104
|
+
Pact Broker will respond with:
|
105
|
+
```json
|
106
|
+
{
|
107
|
+
"status": 200,
|
108
|
+
"body": {
|
109
|
+
"matrix": [
|
110
|
+
{
|
111
|
+
"consumer": {
|
112
|
+
"name": "Foo",
|
113
|
+
"version": {
|
114
|
+
"number": "4"
|
115
|
+
}
|
116
|
+
},
|
117
|
+
"provider": {
|
118
|
+
"name": "Bar",
|
119
|
+
"version": {
|
120
|
+
"number": "5"
|
121
|
+
}
|
122
|
+
},
|
123
|
+
"verificationResult": {
|
124
|
+
"verifiedAt": "2017-10-10T12:49:04+11:00",
|
125
|
+
"success": true
|
126
|
+
},
|
127
|
+
"pact": {
|
128
|
+
"createdAt": "2017-10-10T12:49:04+11:00"
|
129
|
+
}
|
130
|
+
},
|
131
|
+
{
|
132
|
+
"consumer": {
|
133
|
+
"name": "Foo",
|
134
|
+
"version": {
|
135
|
+
"number": "4"
|
136
|
+
}
|
137
|
+
},
|
138
|
+
"provider": {
|
139
|
+
"name": "Bar",
|
140
|
+
"version": {
|
141
|
+
"number": "5"
|
142
|
+
}
|
143
|
+
},
|
144
|
+
"verificationResult": {
|
145
|
+
"verifiedAt": "2017-10-10T12:49:04+11:00",
|
146
|
+
"success": true
|
147
|
+
},
|
148
|
+
"pact": {
|
149
|
+
"createdAt": "2017-10-10T12:49:04+11:00"
|
150
|
+
}
|
151
|
+
}
|
152
|
+
]
|
153
|
+
}
|
154
|
+
}
|
155
|
+
```
|
156
|
+
<a name="a_request_for_the_compatibility_matrix_for_Foo_version_1.2.3_and_Bar_version_4.5.6_given_the_pact_for_Foo_Thing_version_1.2.3_has_been_verified_by_Bar_version_4.5.6"></a>
|
157
|
+
Given **the pact for Foo Thing version 1.2.3 has been verified by Bar version 4.5.6**, upon receiving **a request for the compatibility matrix for Foo version 1.2.3 and Bar version 4.5.6** from Pact Broker Client, with
|
158
|
+
```json
|
159
|
+
{
|
160
|
+
"method": "get",
|
161
|
+
"path": "/matrix",
|
162
|
+
"query": "q[][pacticipant]=Foo%20Thing&q[][version]=1.2.3&q[][pacticipant]=Bar&q[][version]=4.5.6&latestby=cvpv"
|
163
|
+
}
|
164
|
+
```
|
165
|
+
Pact Broker will respond with:
|
166
|
+
```json
|
167
|
+
{
|
168
|
+
"status": 200,
|
169
|
+
"body": {
|
170
|
+
"summary": {
|
171
|
+
"deployable": true,
|
172
|
+
"reason": "some text"
|
173
|
+
},
|
174
|
+
"matrix": [
|
175
|
+
{
|
176
|
+
"consumer": {
|
177
|
+
"name": "Foo",
|
178
|
+
"version": {
|
179
|
+
"number": "4"
|
180
|
+
}
|
181
|
+
},
|
182
|
+
"provider": {
|
183
|
+
"name": "Bar",
|
184
|
+
"version": {
|
185
|
+
"number": "5"
|
186
|
+
}
|
187
|
+
},
|
188
|
+
"verificationResult": {
|
189
|
+
"verifiedAt": "2017-10-10T12:49:04+11:00",
|
190
|
+
"success": true
|
191
|
+
},
|
192
|
+
"pact": {
|
193
|
+
"createdAt": "2017-10-10T12:49:04+11:00"
|
194
|
+
}
|
195
|
+
}
|
196
|
+
]
|
197
|
+
}
|
198
|
+
}
|
199
|
+
```
|
200
|
+
<a name="a_request_for_the_compatibility_matrix_for_Foo_version_1.2.3_and_Bar_version_4.5.6_given_the_pact_for_Foo_version_1.2.3_has_been_verified_by_Bar_version_4.5.6"></a>
|
201
|
+
Given **the pact for Foo version 1.2.3 has been verified by Bar version 4.5.6**, upon receiving **a request for the compatibility matrix for Foo version 1.2.3 and Bar version 4.5.6** from Pact Broker Client, with
|
202
|
+
```json
|
203
|
+
{
|
204
|
+
"method": "get",
|
205
|
+
"path": "/matrix",
|
206
|
+
"query": "q[][pacticipant]=Foo&q[][version]=1.2.3&q[][pacticipant]=Bar&q[][version]=4.5.6&latestby=cvpv"
|
207
|
+
}
|
208
|
+
```
|
209
|
+
Pact Broker will respond with:
|
210
|
+
```json
|
211
|
+
{
|
212
|
+
"status": 200,
|
213
|
+
"body": {
|
214
|
+
"summary": {
|
215
|
+
"deployable": true,
|
216
|
+
"reason": "some text"
|
217
|
+
},
|
218
|
+
"matrix": [
|
219
|
+
{
|
220
|
+
"consumer": {
|
221
|
+
"name": "Foo",
|
222
|
+
"version": {
|
223
|
+
"number": "4"
|
224
|
+
}
|
225
|
+
},
|
226
|
+
"provider": {
|
227
|
+
"name": "Bar",
|
228
|
+
"version": {
|
229
|
+
"number": "5"
|
230
|
+
}
|
231
|
+
},
|
232
|
+
"verificationResult": {
|
233
|
+
"verifiedAt": "2017-10-10T12:49:04+11:00",
|
234
|
+
"success": true
|
235
|
+
},
|
236
|
+
"pact": {
|
237
|
+
"createdAt": "2017-10-10T12:49:04+11:00"
|
238
|
+
}
|
239
|
+
}
|
240
|
+
]
|
241
|
+
}
|
242
|
+
}
|
243
|
+
```
|
244
|
+
<a name="a_request_for_the_compatibility_matrix_for_Foo_version_1.2.3_and_the_latest_prod_version_of_Bar_given_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"></a>
|
245
|
+
Given **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**, upon receiving **a request for the compatibility matrix for Foo version 1.2.3 and the latest prod version of Bar** from Pact Broker Client, with
|
246
|
+
```json
|
247
|
+
{
|
248
|
+
"method": "get",
|
249
|
+
"path": "/matrix",
|
250
|
+
"query": "q[][pacticipant]=Foo&q[][version]=1.2.3&q[][pacticipant]=Bar&q[][latest]=true&q[][tag]=prod&latestby=cvpv"
|
251
|
+
}
|
252
|
+
```
|
253
|
+
Pact Broker will respond with:
|
254
|
+
```json
|
255
|
+
{
|
256
|
+
"status": 200,
|
257
|
+
"body": {
|
258
|
+
"summary": {
|
259
|
+
"deployable": true,
|
260
|
+
"reason": "some text"
|
261
|
+
},
|
262
|
+
"matrix": [
|
263
|
+
{
|
264
|
+
"consumer": {
|
265
|
+
"name": "Foo",
|
266
|
+
"version": {
|
267
|
+
"number": "4"
|
268
|
+
}
|
269
|
+
},
|
270
|
+
"provider": {
|
271
|
+
"name": "Bar",
|
272
|
+
"version": {
|
273
|
+
"number": "5"
|
274
|
+
}
|
275
|
+
},
|
276
|
+
"verificationResult": {
|
277
|
+
"verifiedAt": "2017-10-10T12:49:04+11:00",
|
278
|
+
"success": true
|
279
|
+
},
|
280
|
+
"pact": {
|
281
|
+
"createdAt": "2017-10-10T12:49:04+11:00"
|
282
|
+
}
|
283
|
+
}
|
284
|
+
]
|
285
|
+
}
|
286
|
+
}
|
287
|
+
```
|
288
|
+
<a name="a_request_for_the_compatibility_matrix_for_Foo_version_1.2.3_and_the_latest_prod_versions_of_all_other_pacticipants_given_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"></a>
|
289
|
+
Given **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**, upon receiving **a request for the compatibility matrix for Foo version 1.2.3 and the latest prod versions of all other pacticipants** from Pact Broker Client, with
|
290
|
+
```json
|
291
|
+
{
|
292
|
+
"method": "get",
|
293
|
+
"path": "/matrix",
|
294
|
+
"query": "q[][pacticipant]=Foo&q[][version]=1.2.3&latestby=cvp&latest=true&tag=prod"
|
295
|
+
}
|
296
|
+
```
|
297
|
+
Pact Broker will respond with:
|
298
|
+
```json
|
299
|
+
{
|
300
|
+
"status": 200,
|
301
|
+
"body": {
|
302
|
+
"matrix": [
|
303
|
+
{
|
304
|
+
"consumer": {
|
305
|
+
"name": "Foo",
|
306
|
+
"version": {
|
307
|
+
"number": "1.2.3"
|
308
|
+
}
|
309
|
+
},
|
310
|
+
"provider": {
|
311
|
+
"name": "Bar",
|
312
|
+
"version": {
|
313
|
+
"number": "4.5.6"
|
314
|
+
}
|
315
|
+
}
|
316
|
+
}
|
317
|
+
]
|
318
|
+
}
|
319
|
+
}
|
320
|
+
```
|
321
|
+
<a name="a_request_for_the_compatibility_matrix_for_Foo_version_1.2.3_and_the_latest_version_of_Bar_given_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"></a>
|
322
|
+
Given **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**, upon receiving **a request for the compatibility matrix for Foo version 1.2.3 and the latest version of Bar** from Pact Broker Client, with
|
323
|
+
```json
|
324
|
+
{
|
325
|
+
"method": "get",
|
326
|
+
"path": "/matrix",
|
327
|
+
"query": "q[][pacticipant]=Foo&q[][version]=1.2.4&q[][pacticipant]=Bar&q[][latest]=true&latestby=cvpv"
|
328
|
+
}
|
329
|
+
```
|
330
|
+
Pact Broker will respond with:
|
331
|
+
```json
|
332
|
+
{
|
333
|
+
"status": 200,
|
334
|
+
"body": {
|
335
|
+
"summary": {
|
336
|
+
"deployable": true,
|
337
|
+
"reason": "some text"
|
338
|
+
},
|
339
|
+
"matrix": [
|
340
|
+
{
|
341
|
+
"consumer": {
|
342
|
+
"name": "Foo",
|
343
|
+
"version": {
|
344
|
+
"number": "4"
|
345
|
+
}
|
346
|
+
},
|
347
|
+
"provider": {
|
348
|
+
"name": "Bar",
|
349
|
+
"version": {
|
350
|
+
"number": "5"
|
351
|
+
}
|
352
|
+
},
|
353
|
+
"verificationResult": {
|
354
|
+
"verifiedAt": "2017-10-10T12:49:04+11:00",
|
355
|
+
"success": true
|
356
|
+
},
|
357
|
+
"pact": {
|
358
|
+
"createdAt": "2017-10-10T12:49:04+11:00"
|
359
|
+
}
|
360
|
+
}
|
361
|
+
]
|
362
|
+
}
|
363
|
+
}
|
364
|
+
```
|
365
|
+
<a name="a_request_for_the_compatibility_matrix_where_one_or_more_versions_does_not_exist_given_the_pact_for_Foo_version_1.2.3_has_been_verified_by_Bar_version_4.5.6"></a>
|
366
|
+
Given **the pact for Foo version 1.2.3 has been verified by Bar version 4.5.6**, upon receiving **a request for the compatibility matrix where one or more versions does not exist** from Pact Broker Client, with
|
367
|
+
```json
|
368
|
+
{
|
369
|
+
"method": "get",
|
370
|
+
"path": "/matrix",
|
371
|
+
"query": "q[][pacticipant]=Foo&q[][version]=1.2.3&q[][pacticipant]=Bar&q[][version]=9.9.9&latestby=cvpv"
|
372
|
+
}
|
373
|
+
```
|
374
|
+
Pact Broker will respond with:
|
375
|
+
```json
|
376
|
+
{
|
377
|
+
"status": 400,
|
378
|
+
"body": {
|
379
|
+
"errors": [
|
380
|
+
"an error message"
|
381
|
+
]
|
382
|
+
}
|
383
|
+
}
|
384
|
+
```
|
385
|
+
<a name="a_request_for_the_compatibility_matrix_where_only_the_version_of_Foo_is_specified_given_the_pact_for_Foo_version_1.2.3_has_been_verified_by_Bar_version_4.5.6_and_version_5.6.7"></a>
|
386
|
+
Given **the pact for Foo version 1.2.3 has been verified by Bar version 4.5.6 and version 5.6.7**, upon receiving **a request for the compatibility matrix where only the version of Foo is specified** from Pact Broker Client, with
|
387
|
+
```json
|
388
|
+
{
|
389
|
+
"method": "get",
|
390
|
+
"path": "/matrix",
|
391
|
+
"query": "q[][pacticipant]=Foo&q[][version]=1.2.3&latestby=cvp"
|
392
|
+
}
|
393
|
+
```
|
394
|
+
Pact Broker will respond with:
|
395
|
+
```json
|
396
|
+
{
|
397
|
+
"status": 200,
|
398
|
+
"body": {
|
399
|
+
"summary": {
|
400
|
+
"deployable": true,
|
401
|
+
"reason": "some text"
|
402
|
+
},
|
403
|
+
"matrix": [
|
404
|
+
{
|
405
|
+
"consumer": {
|
406
|
+
"name": "Foo",
|
407
|
+
"version": {
|
408
|
+
"number": "4"
|
409
|
+
}
|
410
|
+
},
|
411
|
+
"provider": {
|
412
|
+
"name": "Bar",
|
413
|
+
"version": {
|
414
|
+
"number": "5"
|
415
|
+
}
|
416
|
+
},
|
417
|
+
"verificationResult": {
|
418
|
+
"verifiedAt": "2017-10-10T12:49:04+11:00",
|
419
|
+
"success": true
|
420
|
+
},
|
421
|
+
"pact": {
|
422
|
+
"createdAt": "2017-10-10T12:49:04+11:00"
|
423
|
+
}
|
424
|
+
}
|
425
|
+
]
|
426
|
+
}
|
427
|
+
}
|
428
|
+
```
|
429
|
+
<a name="a_request_for_the_index_resource_given_the_pb:latest-tagged-version_relation_exists_in_the_index_resource"></a>
|
430
|
+
Given **the pb:latest-tagged-version relation exists in the index resource**, upon receiving **a request for the index resource** from Pact Broker Client, with
|
431
|
+
```json
|
432
|
+
{
|
433
|
+
"method": "get",
|
434
|
+
"path": "/",
|
435
|
+
"headers": {
|
436
|
+
"Accept": "application/json, application/hal+json"
|
437
|
+
}
|
438
|
+
}
|
439
|
+
```
|
440
|
+
Pact Broker will respond with:
|
441
|
+
```json
|
442
|
+
{
|
443
|
+
"status": 200,
|
444
|
+
"body": {
|
445
|
+
"_links": {
|
446
|
+
"pb:latest-tagged-version": {
|
447
|
+
"href": "http://localhost:1234/HAL-REL-PLACEHOLDER-INDEX-PB-LATEST-TAGGED-VERSION-{pacticipant}-{tag}"
|
448
|
+
}
|
449
|
+
}
|
450
|
+
}
|
451
|
+
}
|
452
|
+
```
|
453
|
+
<a name="a_request_for_the_index_resource_given_the_pb:latest-version_relation_exists_in_the_index_resource"></a>
|
454
|
+
Given **the pb:latest-version relation exists in the index resource**, upon receiving **a request for the index resource** from Pact Broker Client, with
|
455
|
+
```json
|
456
|
+
{
|
457
|
+
"method": "get",
|
458
|
+
"path": "/",
|
459
|
+
"headers": {
|
460
|
+
"Accept": "application/json, application/hal+json"
|
461
|
+
}
|
462
|
+
}
|
463
|
+
```
|
464
|
+
Pact Broker will respond with:
|
465
|
+
```json
|
466
|
+
{
|
467
|
+
"status": 200,
|
468
|
+
"body": {
|
469
|
+
"_links": {
|
470
|
+
"pb:latest-version": {
|
471
|
+
"href": "http://localhost:1234/HAL-REL-PLACEHOLDER-INDEX-PB-LATEST-VERSION-{pacticipant}"
|
472
|
+
}
|
473
|
+
}
|
474
|
+
}
|
475
|
+
}
|
476
|
+
```
|
477
|
+
<a name="a_request_for_the_list_of_the_latest_pacts_from_all_consumers_for_the_Pricing_Service'_given_a_latest_pact_between_Condor_and_the_Pricing_Service_exists"></a>
|
478
|
+
Given **a latest pact between Condor and the Pricing Service exists**, upon receiving **a request for the list of the latest pacts from all consumers for the Pricing Service'** from Pact Broker Client, with
|
479
|
+
```json
|
480
|
+
{
|
481
|
+
"method": "get",
|
482
|
+
"path": "/pacts/provider/Pricing%20Service/latest"
|
483
|
+
}
|
484
|
+
```
|
485
|
+
Pact Broker will respond with:
|
486
|
+
```json
|
487
|
+
{
|
488
|
+
"status": 200,
|
489
|
+
"body": {
|
490
|
+
"_links": {
|
491
|
+
"provider": {
|
492
|
+
"href": "http://example.org/pacticipants/Pricing%20Service",
|
493
|
+
"title": "Pricing Service"
|
494
|
+
},
|
495
|
+
"pacts": [
|
496
|
+
{
|
497
|
+
"href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0",
|
498
|
+
"title": "Pact between Condor (v1.3.0) and Pricing Service",
|
499
|
+
"name": "Condor"
|
500
|
+
}
|
501
|
+
]
|
502
|
+
}
|
503
|
+
}
|
504
|
+
}
|
505
|
+
```
|
506
|
+
<a name="a_request_for_the_list_of_the_latest_prod_pacts_from_all_consumers_for_the_Pricing_Service'_given_tagged_as_prod_pact_between_Condor_and_the_Pricing_Service_exists"></a>
|
507
|
+
Given **tagged as prod pact between Condor and the Pricing Service exists**, upon receiving **a request for the list of the latest prod pacts from all consumers for the Pricing Service'** from Pact Broker Client, with
|
508
|
+
```json
|
509
|
+
{
|
510
|
+
"method": "get",
|
511
|
+
"path": "/pacts/provider/Pricing%20Service/latest/prod"
|
512
|
+
}
|
513
|
+
```
|
514
|
+
Pact Broker will respond with:
|
515
|
+
```json
|
516
|
+
{
|
517
|
+
"status": 200,
|
518
|
+
"body": {
|
519
|
+
"_links": {
|
520
|
+
"provider": {
|
521
|
+
"href": "http://example.org/pacticipants/Pricing%20Service",
|
522
|
+
"title": "Pricing Service"
|
523
|
+
},
|
524
|
+
"pacts": [
|
525
|
+
{
|
526
|
+
"href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0",
|
527
|
+
"title": "Pact between Condor (v1.3.0) and Pricing Service",
|
528
|
+
"name": "Condor"
|
529
|
+
}
|
530
|
+
]
|
531
|
+
}
|
532
|
+
}
|
533
|
+
}
|
534
|
+
```
|
535
|
+
<a name="a_request_for_the_successful_rows_of_the_compatibility_matrix_for_all_versions_of_Foo_and_Bar_given_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"></a>
|
536
|
+
Given **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**, upon receiving **a request for the successful rows of the compatibility matrix for all versions of Foo and Bar** from Pact Broker Client, with
|
537
|
+
```json
|
538
|
+
{
|
539
|
+
"method": "get",
|
540
|
+
"path": "/matrix",
|
541
|
+
"query": "q[][pacticipant]=Foo&q[][pacticipant]=Bar&latestby=cvpv&success[]=true"
|
542
|
+
}
|
543
|
+
```
|
544
|
+
Pact Broker will respond with:
|
545
|
+
```json
|
546
|
+
{
|
547
|
+
"status": 200,
|
548
|
+
"body": {
|
549
|
+
"summary": {
|
550
|
+
"deployable": true,
|
551
|
+
"reason": "some text"
|
552
|
+
},
|
553
|
+
"matrix": [
|
554
|
+
{
|
555
|
+
"consumer": {
|
556
|
+
"name": "Foo",
|
557
|
+
"version": {
|
558
|
+
"number": "4"
|
559
|
+
}
|
560
|
+
},
|
561
|
+
"provider": {
|
562
|
+
"name": "Bar",
|
563
|
+
"version": {
|
564
|
+
"number": "5"
|
565
|
+
}
|
566
|
+
},
|
567
|
+
"verificationResult": {
|
568
|
+
"verifiedAt": "2017-10-10T12:49:04+11:00",
|
569
|
+
"success": true
|
570
|
+
},
|
571
|
+
"pact": {
|
572
|
+
"createdAt": "2017-10-10T12:49:04+11:00"
|
573
|
+
}
|
574
|
+
}
|
575
|
+
]
|
576
|
+
}
|
577
|
+
}
|
578
|
+
```
|
579
|
+
<a name="a_request_retrieve_a_pact_for_a_specific_version_given_the_'Pricing_Service'_and_'Condor'_already_exist_in_the_pact-broker,_and_Condor_already_has_a_pact_published_for_version_1.3.0"></a>
|
580
|
+
Given **the 'Pricing Service' and 'Condor' already exist in the pact-broker, and Condor already has a pact published for version 1.3.0**, upon receiving **a request retrieve a pact for a specific version** from Pact Broker Client, with
|
581
|
+
```json
|
582
|
+
{
|
583
|
+
"method": "get",
|
584
|
+
"path": "/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0"
|
585
|
+
}
|
586
|
+
```
|
587
|
+
Pact Broker will respond with:
|
588
|
+
```json
|
589
|
+
{
|
590
|
+
"status": 200,
|
591
|
+
"body": {
|
592
|
+
"consumer": {
|
593
|
+
"name": "Condor"
|
594
|
+
},
|
595
|
+
"provider": {
|
596
|
+
"name": "Pricing Service"
|
597
|
+
},
|
598
|
+
"interactions": [
|
599
|
+
|
600
|
+
]
|
601
|
+
}
|
602
|
+
}
|
603
|
+
```
|
604
|
+
<a name="a_request_to_get_the_Pricing_Service_given_the_'Pricing_Service'_already_exists_in_the_pact-broker"></a>
|
605
|
+
Given **the 'Pricing Service' already exists in the pact-broker**, upon receiving **a request to get the Pricing Service** from Pact Broker Client, with
|
606
|
+
```json
|
607
|
+
{
|
608
|
+
"method": "get",
|
609
|
+
"path": "/pacticipants/Pricing%20Service"
|
610
|
+
}
|
611
|
+
```
|
612
|
+
Pact Broker will respond with:
|
613
|
+
```json
|
614
|
+
{
|
615
|
+
"status": 200,
|
616
|
+
"headers": {
|
617
|
+
"Content-Type": "application/hal+json"
|
618
|
+
},
|
619
|
+
"body": {
|
620
|
+
"_links": {
|
621
|
+
"self": {
|
622
|
+
"href": "http://example.org/pacticipants/Pricing%20Service"
|
623
|
+
},
|
624
|
+
"versions": {
|
625
|
+
"href": "http://example.org/pacticipants/Pricing%20Service/versions"
|
626
|
+
}
|
627
|
+
},
|
628
|
+
"name": "Pricing Service",
|
629
|
+
"repositoryUrl": "git@git.realestate.com.au:business-systems/pricing-service",
|
630
|
+
"_embedded": {
|
631
|
+
"latest-version": {
|
632
|
+
"_links": {
|
633
|
+
"self": {
|
634
|
+
"href": "http://example.org/pacticipants/Pricing%20Service/versions/1.3.0"
|
635
|
+
}
|
636
|
+
},
|
637
|
+
"number": "1.3.0"
|
638
|
+
}
|
639
|
+
}
|
640
|
+
}
|
641
|
+
}
|
642
|
+
```
|
643
|
+
<a name="a_request_to_get_the_Pricing_Service_given_the_'Pricing_Service'_does_not_exist_in_the_pact-broker"></a>
|
644
|
+
Given **the 'Pricing Service' does not exist in the pact-broker**, upon receiving **a request to get the Pricing Service** from Pact Broker Client, with
|
645
|
+
```json
|
646
|
+
{
|
647
|
+
"method": "get",
|
648
|
+
"path": "/pacticipants/Pricing%20Service"
|
649
|
+
}
|
650
|
+
```
|
651
|
+
Pact Broker will respond with:
|
652
|
+
```json
|
653
|
+
{
|
654
|
+
"status": 404
|
655
|
+
}
|
656
|
+
```
|
657
|
+
<a name="a_request_to_list_pacticipants_given_'Condor'_exists_in_the_pact-broker"></a>
|
658
|
+
Given **'Condor' exists in the pact-broker**, upon receiving **a request to list pacticipants** from Pact Broker Client, with
|
659
|
+
```json
|
660
|
+
{
|
661
|
+
"method": "get",
|
662
|
+
"path": "/pacticipants"
|
663
|
+
}
|
664
|
+
```
|
665
|
+
Pact Broker will respond with:
|
666
|
+
```json
|
667
|
+
{
|
668
|
+
"status": 200,
|
669
|
+
"headers": {
|
670
|
+
"Content-Type": "application/hal+json"
|
671
|
+
},
|
672
|
+
"body": {
|
673
|
+
"_links": {
|
674
|
+
"self": {
|
675
|
+
"href": "http://example.org/pacticipants"
|
676
|
+
},
|
677
|
+
"pacticipants": [
|
678
|
+
{
|
679
|
+
"href": "http://example.org/pacticipants/Condor",
|
680
|
+
"title": "Condor"
|
681
|
+
}
|
682
|
+
]
|
683
|
+
},
|
684
|
+
"pacticipants": [
|
685
|
+
{
|
686
|
+
"_links": {
|
687
|
+
"self": {
|
688
|
+
"href": "http://example.org/pacticipants/Condor"
|
689
|
+
}
|
690
|
+
},
|
691
|
+
"name": "Condor",
|
692
|
+
"_embedded": {
|
693
|
+
"latest-version": {
|
694
|
+
"_links": {
|
695
|
+
"self": {
|
696
|
+
"href": "http://example.org/pacticipants/Condor/versions/1.3.0"
|
697
|
+
}
|
698
|
+
},
|
699
|
+
"number": "1.3.0"
|
700
|
+
}
|
701
|
+
}
|
702
|
+
}
|
703
|
+
]
|
704
|
+
}
|
705
|
+
}
|
706
|
+
```
|
707
|
+
<a name="a_request_to_list_the_latest_pacts_given_a_pact_between_Condor_and_the_Pricing_Service_exists"></a>
|
708
|
+
Given **a pact between Condor and the Pricing Service exists**, upon receiving **a request to list the latest pacts** from Pact Broker Client, with
|
709
|
+
```json
|
710
|
+
{
|
711
|
+
"method": "get",
|
712
|
+
"path": "/pacts/latest"
|
713
|
+
}
|
714
|
+
```
|
715
|
+
Pact Broker will respond with:
|
716
|
+
```json
|
717
|
+
{
|
718
|
+
"status": 200,
|
719
|
+
"headers": {
|
720
|
+
"Content-Type": "application/hal+json"
|
721
|
+
},
|
722
|
+
"body": {
|
723
|
+
"_links": {
|
724
|
+
"self": {
|
725
|
+
"href": "http://example.org/pacts/latest"
|
726
|
+
}
|
727
|
+
},
|
728
|
+
"pacts": [
|
729
|
+
{
|
730
|
+
"_links": {
|
731
|
+
"self": [
|
732
|
+
{
|
733
|
+
"href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/latest"
|
734
|
+
},
|
735
|
+
{
|
736
|
+
"href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0"
|
737
|
+
}
|
738
|
+
]
|
739
|
+
},
|
740
|
+
"_embedded": {
|
741
|
+
"consumer": {
|
742
|
+
"name": "Condor",
|
743
|
+
"_links": {
|
744
|
+
"self": {
|
745
|
+
"href": "http://example.org/pacticipants/Condor"
|
746
|
+
}
|
747
|
+
},
|
748
|
+
"_embedded": {
|
749
|
+
"version": {
|
750
|
+
"number": "1.3.0"
|
751
|
+
}
|
752
|
+
}
|
753
|
+
},
|
754
|
+
"provider": {
|
755
|
+
"_links": {
|
756
|
+
"self": {
|
757
|
+
"href": "http://example.org/pacticipants/Pricing%20Service"
|
758
|
+
}
|
759
|
+
},
|
760
|
+
"name": "Pricing Service"
|
761
|
+
}
|
762
|
+
}
|
763
|
+
}
|
764
|
+
]
|
765
|
+
}
|
766
|
+
}
|
767
|
+
```
|
768
|
+
<a name="a_request_to_publish_a_pact_given_'Condor'_already_exist_in_the_pact-broker,_but_the_'Pricing_Service'_does_not"></a>
|
769
|
+
Given **'Condor' already exist in the pact-broker, but the 'Pricing Service' does not**, upon receiving **a request to publish a pact** from Pact Broker Client, with
|
770
|
+
```json
|
771
|
+
{
|
772
|
+
"method": "put",
|
773
|
+
"path": "/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0",
|
774
|
+
"headers": {
|
775
|
+
"Content-Type": "application/json"
|
776
|
+
},
|
777
|
+
"body": {
|
778
|
+
"consumer": {
|
779
|
+
"name": "Condor"
|
780
|
+
},
|
781
|
+
"provider": {
|
782
|
+
"name": "Pricing Service"
|
783
|
+
},
|
784
|
+
"interactions": [
|
785
|
+
|
786
|
+
]
|
787
|
+
}
|
788
|
+
}
|
789
|
+
```
|
790
|
+
Pact Broker will respond with:
|
791
|
+
```json
|
792
|
+
{
|
793
|
+
"status": 201,
|
794
|
+
"body": {
|
795
|
+
"_links": {
|
796
|
+
"pb:latest-pact-version": {
|
797
|
+
"href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/latest"
|
798
|
+
}
|
799
|
+
}
|
800
|
+
}
|
801
|
+
}
|
802
|
+
```
|
803
|
+
<a name="a_request_to_publish_a_pact_given_the_'Pricing_Service'_already_exists_in_the_pact-broker"></a>
|
804
|
+
Given **the 'Pricing Service' already exists in the pact-broker**, upon receiving **a request to publish a pact** from Pact Broker Client, with
|
805
|
+
```json
|
806
|
+
{
|
807
|
+
"method": "put",
|
808
|
+
"path": "/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0",
|
809
|
+
"headers": {
|
810
|
+
"Content-Type": "application/json"
|
811
|
+
},
|
812
|
+
"body": {
|
813
|
+
"consumer": {
|
814
|
+
"name": "Condor"
|
815
|
+
},
|
816
|
+
"provider": {
|
817
|
+
"name": "Pricing Service"
|
818
|
+
},
|
819
|
+
"interactions": [
|
820
|
+
|
821
|
+
]
|
822
|
+
}
|
823
|
+
}
|
824
|
+
```
|
825
|
+
Pact Broker will respond with:
|
826
|
+
```json
|
827
|
+
{
|
828
|
+
"status": 201,
|
829
|
+
"body": {
|
830
|
+
"_links": {
|
831
|
+
"pb:latest-pact-version": {
|
832
|
+
"href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/latest"
|
833
|
+
}
|
834
|
+
}
|
835
|
+
}
|
836
|
+
}
|
837
|
+
```
|
838
|
+
<a name="a_request_to_publish_a_pact_given_an_error_occurs_while_publishing_a_pact"></a>
|
839
|
+
Given **an error occurs while publishing a pact**, upon receiving **a request to publish a pact** from Pact Broker Client, with
|
840
|
+
```json
|
841
|
+
{
|
842
|
+
"method": "put",
|
843
|
+
"path": "/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0",
|
844
|
+
"headers": {
|
845
|
+
"Content-Type": "application/json"
|
846
|
+
},
|
847
|
+
"body": {
|
848
|
+
"consumer": {
|
849
|
+
"name": "Condor"
|
850
|
+
},
|
851
|
+
"provider": {
|
852
|
+
"name": "Pricing Service"
|
853
|
+
},
|
854
|
+
"interactions": [
|
855
|
+
|
856
|
+
]
|
857
|
+
}
|
858
|
+
}
|
859
|
+
```
|
860
|
+
Pact Broker will respond with:
|
861
|
+
```json
|
862
|
+
{
|
863
|
+
"status": 500,
|
864
|
+
"headers": {
|
865
|
+
"Content-Type": "application/hal+json"
|
866
|
+
},
|
867
|
+
"body": {
|
868
|
+
"message": "An error occurred"
|
869
|
+
}
|
870
|
+
}
|
871
|
+
```
|
872
|
+
<a name="a_request_to_publish_a_pact_with_method_patch_given_the_'Pricing_Service'_and_'Condor'_already_exist_in_the_pact-broker,_and_Condor_already_has_a_pact_published_for_version_1.3.0"></a>
|
873
|
+
Given **the 'Pricing Service' and 'Condor' already exist in the pact-broker, and Condor already has a pact published for version 1.3.0**, upon receiving **a request to publish a pact with method patch** from Pact Broker Client, with
|
874
|
+
```json
|
875
|
+
{
|
876
|
+
"method": "patch",
|
877
|
+
"path": "/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0",
|
878
|
+
"headers": {
|
879
|
+
"Content-Type": "application/json"
|
880
|
+
},
|
881
|
+
"body": {
|
882
|
+
"consumer": {
|
883
|
+
"name": "Condor"
|
884
|
+
},
|
885
|
+
"provider": {
|
886
|
+
"name": "Pricing Service"
|
887
|
+
},
|
888
|
+
"interactions": [
|
889
|
+
|
890
|
+
]
|
891
|
+
}
|
892
|
+
}
|
893
|
+
```
|
894
|
+
Pact Broker will respond with:
|
895
|
+
```json
|
896
|
+
{
|
897
|
+
"status": 200,
|
898
|
+
"body": {
|
899
|
+
"_links": {
|
900
|
+
"pb:latest-pact-version": {
|
901
|
+
"href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/latest"
|
902
|
+
}
|
903
|
+
}
|
904
|
+
}
|
905
|
+
}
|
906
|
+
```
|
907
|
+
<a name="a_request_to_publish_a_pact_with_method_put_given_the_'Pricing_Service'_and_'Condor'_already_exist_in_the_pact-broker,_and_Condor_already_has_a_pact_published_for_version_1.3.0"></a>
|
908
|
+
Given **the 'Pricing Service' and 'Condor' already exist in the pact-broker, and Condor already has a pact published for version 1.3.0**, upon receiving **a request to publish a pact with method put** from Pact Broker Client, with
|
909
|
+
```json
|
910
|
+
{
|
911
|
+
"method": "put",
|
912
|
+
"path": "/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0",
|
913
|
+
"headers": {
|
914
|
+
"Content-Type": "application/json"
|
915
|
+
},
|
916
|
+
"body": {
|
917
|
+
"consumer": {
|
918
|
+
"name": "Condor"
|
919
|
+
},
|
920
|
+
"provider": {
|
921
|
+
"name": "Pricing Service"
|
922
|
+
},
|
923
|
+
"interactions": [
|
924
|
+
|
925
|
+
]
|
926
|
+
}
|
927
|
+
}
|
928
|
+
```
|
929
|
+
Pact Broker will respond with:
|
930
|
+
```json
|
931
|
+
{
|
932
|
+
"status": 200,
|
933
|
+
"body": {
|
934
|
+
"_links": {
|
935
|
+
"pb:latest-pact-version": {
|
936
|
+
"href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/latest"
|
937
|
+
}
|
938
|
+
}
|
939
|
+
}
|
940
|
+
}
|
941
|
+
```
|
942
|
+
<a name="a_request_to_register_the_repository_URL_of_a_pacticipant_given_the_'Pricing_Service'_already_exists_in_the_pact-broker"></a>
|
943
|
+
Given **the 'Pricing Service' already exists in the pact-broker**, upon receiving **a request to register the repository URL of a pacticipant** from Pact Broker Client, with
|
944
|
+
```json
|
945
|
+
{
|
946
|
+
"method": "patch",
|
947
|
+
"path": "/pacticipants/Pricing%20Service",
|
948
|
+
"headers": {
|
949
|
+
"Content-Type": "application/json"
|
950
|
+
},
|
951
|
+
"body": {
|
952
|
+
"repository_url": "git@git.realestate.com.au:business-systems/pricing-service"
|
953
|
+
}
|
954
|
+
}
|
955
|
+
```
|
956
|
+
Pact Broker will respond with:
|
957
|
+
```json
|
958
|
+
{
|
959
|
+
"status": 200
|
960
|
+
}
|
961
|
+
```
|
962
|
+
<a name="a_request_to_register_the_repository_URL_of_a_pacticipant_given_the_'Pricing_Service'_does_not_exist_in_the_pact-broker"></a>
|
963
|
+
Given **the 'Pricing Service' does not exist in the pact-broker**, upon receiving **a request to register the repository URL of a pacticipant** from Pact Broker Client, with
|
964
|
+
```json
|
965
|
+
{
|
966
|
+
"method": "patch",
|
967
|
+
"path": "/pacticipants/Pricing%20Service",
|
968
|
+
"headers": {
|
969
|
+
"Content-Type": "application/json"
|
970
|
+
},
|
971
|
+
"body": {
|
972
|
+
"repository_url": "git@git.realestate.com.au:business-systems/pricing-service"
|
973
|
+
}
|
974
|
+
}
|
975
|
+
```
|
976
|
+
Pact Broker will respond with:
|
977
|
+
```json
|
978
|
+
{
|
979
|
+
"status": 201
|
980
|
+
}
|
981
|
+
```
|
982
|
+
<a name="a_request_to_retrieve_the_latest_'production'_version_of_Condor_given_'Condor'_exists_in_the_pact-broker_with_the_latest_tagged_'production'_version_1.2.3"></a>
|
983
|
+
Given **'Condor' exists in the pact-broker with the latest tagged 'production' version 1.2.3**, upon receiving **a request to retrieve the latest 'production' version of Condor** from Pact Broker Client, with
|
984
|
+
```json
|
985
|
+
{
|
986
|
+
"method": "get",
|
987
|
+
"path": "/HAL-REL-PLACEHOLDER-INDEX-PB-LATEST-TAGGED-VERSION-Condor-production",
|
988
|
+
"headers": {
|
989
|
+
"Accept": "application/json, application/hal+json"
|
990
|
+
}
|
991
|
+
}
|
992
|
+
```
|
993
|
+
Pact Broker will respond with:
|
994
|
+
```json
|
995
|
+
{
|
996
|
+
"status": 200,
|
997
|
+
"body": {
|
998
|
+
"number": "1.2.3",
|
999
|
+
"_links": {
|
1000
|
+
"self": {
|
1001
|
+
"href": "http://localhost:1234/some-url"
|
1002
|
+
}
|
1003
|
+
}
|
1004
|
+
}
|
1005
|
+
}
|
1006
|
+
```
|
1007
|
+
<a name="a_request_to_retrieve_the_latest_pact_between_Condor_and_the_Pricing_Service_given_a_pact_between_Condor_and_the_Pricing_Service_exists"></a>
|
1008
|
+
Given **a pact between Condor and the Pricing Service exists**, upon receiving **a request to retrieve the latest pact between Condor and the Pricing Service** from Pact Broker Client, with
|
1009
|
+
```json
|
1010
|
+
{
|
1011
|
+
"method": "get",
|
1012
|
+
"path": "/pacts/provider/Pricing%20Service/consumer/Condor/latest"
|
1013
|
+
}
|
1014
|
+
```
|
1015
|
+
Pact Broker will respond with:
|
1016
|
+
```json
|
1017
|
+
{
|
1018
|
+
"status": 200,
|
1019
|
+
"headers": {
|
1020
|
+
"Content-Type": "application/hal+json",
|
1021
|
+
"X-Pact-Consumer-Version": "1.3.0"
|
1022
|
+
},
|
1023
|
+
"body": {
|
1024
|
+
"consumer": {
|
1025
|
+
"name": "Condor"
|
1026
|
+
},
|
1027
|
+
"provider": {
|
1028
|
+
"name": "Pricing Service"
|
1029
|
+
},
|
1030
|
+
"interactions": [
|
1031
|
+
|
1032
|
+
]
|
1033
|
+
}
|
1034
|
+
}
|
1035
|
+
```
|
1036
|
+
<a name="a_request_to_retrieve_the_latest_pact_between_Condor_and_the_Pricing_Service_given_no_pact_between_Condor_and_the_Pricing_Service_exists"></a>
|
1037
|
+
Given **no pact between Condor and the Pricing Service exists**, upon receiving **a request to retrieve the latest pact between Condor and the Pricing Service** from Pact Broker Client, with
|
1038
|
+
```json
|
1039
|
+
{
|
1040
|
+
"method": "get",
|
1041
|
+
"path": "/pacts/provider/Pricing%20Service/consumer/Condor/latest"
|
1042
|
+
}
|
1043
|
+
```
|
1044
|
+
Pact Broker will respond with:
|
1045
|
+
```json
|
1046
|
+
{
|
1047
|
+
"status": 404
|
1048
|
+
}
|
1049
|
+
```
|
1050
|
+
<a name="a_request_to_retrieve_the_latest_version_of_Condor_given_'Condor'_exists_in_the_pact-broker_with_the_latest_version_1.2.3"></a>
|
1051
|
+
Given **'Condor' exists in the pact-broker with the latest version 1.2.3**, upon receiving **a request to retrieve the latest version of Condor** from Pact Broker Client, with
|
1052
|
+
```json
|
1053
|
+
{
|
1054
|
+
"method": "get",
|
1055
|
+
"path": "/HAL-REL-PLACEHOLDER-INDEX-PB-LATEST-VERSION-Condor",
|
1056
|
+
"headers": {
|
1057
|
+
"Accept": "application/json, application/hal+json"
|
1058
|
+
}
|
1059
|
+
}
|
1060
|
+
```
|
1061
|
+
Pact Broker will respond with:
|
1062
|
+
```json
|
1063
|
+
{
|
1064
|
+
"status": 200,
|
1065
|
+
"body": {
|
1066
|
+
"number": "1.2.3",
|
1067
|
+
"_links": {
|
1068
|
+
"self": {
|
1069
|
+
"href": "http://localhost:1234/some-url"
|
1070
|
+
}
|
1071
|
+
}
|
1072
|
+
}
|
1073
|
+
}
|
1074
|
+
```
|
1075
|
+
<a name="a_request_to_retrieve_the_pact_between_the_production_verison_of_Condor_and_the_Pricing_Service_given_a_pact_between_Condor_and_the_Pricing_Service_exists_for_the_production_version_of_Condor"></a>
|
1076
|
+
Given **a pact between Condor and the Pricing Service exists for the production version of Condor**, upon receiving **a request to retrieve the pact between the production verison of Condor and the Pricing Service** from Pact Broker Client, with
|
1077
|
+
```json
|
1078
|
+
{
|
1079
|
+
"method": "get",
|
1080
|
+
"path": "/pacts/provider/Pricing%20Service/consumer/Condor/latest/prod",
|
1081
|
+
"headers": {
|
1082
|
+
"Accept": "application/json, application/hal+json"
|
1083
|
+
}
|
1084
|
+
}
|
1085
|
+
```
|
1086
|
+
Pact Broker will respond with:
|
1087
|
+
```json
|
1088
|
+
{
|
1089
|
+
"status": 200,
|
1090
|
+
"body": {
|
1091
|
+
"consumer": {
|
1092
|
+
"name": "Condor"
|
1093
|
+
},
|
1094
|
+
"provider": {
|
1095
|
+
"name": "Pricing Service"
|
1096
|
+
},
|
1097
|
+
"interactions": [
|
1098
|
+
|
1099
|
+
]
|
1100
|
+
}
|
1101
|
+
}
|
1102
|
+
```
|
1103
|
+
<a name="a_request_to_tag_the_production_version_of_Condor_given_'Condor'_exists_in_the_pact-broker_with_version_1.3.0,_tagged_with_'prod'"></a>
|
1104
|
+
Given **'Condor' exists in the pact-broker with version 1.3.0, tagged with 'prod'**, upon receiving **a request to tag the production version of Condor** from Pact Broker Client, with
|
1105
|
+
```json
|
1106
|
+
{
|
1107
|
+
"method": "put",
|
1108
|
+
"path": "/pacticipants/Condor/versions/1.3.0/tags/prod",
|
1109
|
+
"headers": {
|
1110
|
+
"Content-Type": "application/json"
|
1111
|
+
}
|
1112
|
+
}
|
1113
|
+
```
|
1114
|
+
Pact Broker will respond with:
|
1115
|
+
```json
|
1116
|
+
{
|
1117
|
+
"status": 200,
|
1118
|
+
"body": {
|
1119
|
+
"_links": {
|
1120
|
+
"self": {
|
1121
|
+
"href": "http://localhost:1234/pacticipants/Condor/versions/1.3.0/tags/prod"
|
1122
|
+
}
|
1123
|
+
}
|
1124
|
+
}
|
1125
|
+
}
|
1126
|
+
```
|
1127
|
+
<a name="a_request_to_tag_the_production_version_of_Condor_given_'Condor'_does_not_exist_in_the_pact-broker"></a>
|
1128
|
+
Given **'Condor' does not exist in the pact-broker**, upon receiving **a request to tag the production version of Condor** from Pact Broker Client, with
|
1129
|
+
```json
|
1130
|
+
{
|
1131
|
+
"method": "put",
|
1132
|
+
"path": "/pacticipants/Condor/versions/1.3.0/tags/prod",
|
1133
|
+
"headers": {
|
1134
|
+
"Content-Type": "application/json"
|
1135
|
+
}
|
1136
|
+
}
|
1137
|
+
```
|
1138
|
+
Pact Broker will respond with:
|
1139
|
+
```json
|
1140
|
+
{
|
1141
|
+
"status": 201,
|
1142
|
+
"body": {
|
1143
|
+
"_links": {
|
1144
|
+
"self": {
|
1145
|
+
"href": "http://localhost:1234/pacticipants/Condor/versions/1.3.0/tags/prod"
|
1146
|
+
}
|
1147
|
+
}
|
1148
|
+
}
|
1149
|
+
}
|
1150
|
+
```
|
1151
|
+
<a name="a_request_to_tag_the_production_version_of_Condor_given_'Condor'_exists_in_the_pact-broker"></a>
|
1152
|
+
Given **'Condor' exists in the pact-broker**, upon receiving **a request to tag the production version of Condor** from Pact Broker Client, with
|
1153
|
+
```json
|
1154
|
+
{
|
1155
|
+
"method": "put",
|
1156
|
+
"path": "/pacticipants/Condor/versions/1.3.0/tags/prod",
|
1157
|
+
"headers": {
|
1158
|
+
"Content-Type": "application/json"
|
1159
|
+
}
|
1160
|
+
}
|
1161
|
+
```
|
1162
|
+
Pact Broker will respond with:
|
1163
|
+
```json
|
1164
|
+
{
|
1165
|
+
"status": 201,
|
1166
|
+
"body": {
|
1167
|
+
"_links": {
|
1168
|
+
"self": {
|
1169
|
+
"href": "http://localhost:1234/pacticipants/Condor/versions/1.3.0/tags/prod"
|
1170
|
+
}
|
1171
|
+
}
|
1172
|
+
}
|
1173
|
+
}
|
1174
|
+
```
|