pact_broker-client 1.75.3 → 1.75.4

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.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/lib/pact_broker/client/version.rb +1 -1
  4. metadata +5 -216
  5. data/.github/workflows/test.yml +0 -59
  6. data/.rspec +0 -3
  7. data/lib/pact_broker/client/pacts/list_latest_versions.rb +0 -66
  8. data/lib/pact_broker/client/webhooks/test.rb +0 -16
  9. data/pact-broker-client.gemspec +0 -31
  10. data/spec/fixtures/MyConsumer-MyProvider (1).json +0 -37
  11. data/spec/fixtures/MyConsumer-MyProvider.json +0 -37
  12. data/spec/fixtures/approvals/can_i_deploy_failure_dry_run.approved.txt +0 -7
  13. data/spec/fixtures/approvals/can_i_deploy_ignore.approved.txt +0 -13
  14. data/spec/fixtures/approvals/can_i_deploy_success_dry_run.approved.txt +0 -7
  15. data/spec/fixtures/approvals/describe_environment.approved.txt +0 -7
  16. data/spec/fixtures/approvals/describe_pacticipant.approved.txt +0 -2
  17. data/spec/fixtures/approvals/list_environments.approved.txt +0 -3
  18. data/spec/fixtures/approvals/publish_provider_contract.approved.txt +0 -2
  19. data/spec/fixtures/certificates/ca_cert.pem +0 -19
  20. data/spec/fixtures/certificates/ca_cert.srl +0 -1
  21. data/spec/fixtures/certificates/ca_key.pem +0 -28
  22. data/spec/fixtures/certificates/client_cert.pem +0 -17
  23. data/spec/fixtures/certificates/key.pem +0 -28
  24. data/spec/fixtures/certificates/server.csr +0 -15
  25. data/spec/fixtures/certificates/unsigned_cert.pem +0 -19
  26. data/spec/fixtures/certificates/unsigned_key.pem +0 -28
  27. data/spec/fixtures/foo-bar.json +0 -31
  28. data/spec/integration/can_i_deploy_spec.rb +0 -24
  29. data/spec/integration/can_i_merge_spec.rb +0 -44
  30. data/spec/integration/create_version_tag_spec.rb +0 -20
  31. data/spec/integration/describe_environment_spec.rb +0 -31
  32. data/spec/integration/publish_provider_contract_spec.rb +0 -53
  33. data/spec/integration/unknown_options_spec.rb +0 -39
  34. data/spec/lib/pact_broker/client/base_client_spec.rb +0 -182
  35. data/spec/lib/pact_broker/client/branches/delete_branch_spec.rb +0 -103
  36. data/spec/lib/pact_broker/client/can_i_deploy_spec.rb +0 -250
  37. data/spec/lib/pact_broker/client/cli/broker_can_i_deploy_spec.rb +0 -196
  38. data/spec/lib/pact_broker/client/cli/broker_create_or_update_webhook_spec.rb +0 -23
  39. data/spec/lib/pact_broker/client/cli/broker_create_webhook_spec.rb +0 -23
  40. data/spec/lib/pact_broker/client/cli/broker_publish_spec.rb +0 -327
  41. data/spec/lib/pact_broker/client/cli/broker_run_webhook_commands_spec.rb +0 -287
  42. data/spec/lib/pact_broker/client/cli/custom_thor_spec.rb +0 -174
  43. data/spec/lib/pact_broker/client/cli/version_selector_options_parser_spec.rb +0 -97
  44. data/spec/lib/pact_broker/client/deployments/record_deployment_spec.rb +0 -224
  45. data/spec/lib/pact_broker/client/deployments/record_support_ended_spec.rb +0 -208
  46. data/spec/lib/pact_broker/client/deployments/record_undeployment_spec.rb +0 -227
  47. data/spec/lib/pact_broker/client/environments/delete_environment_spec.rb +0 -120
  48. data/spec/lib/pact_broker/client/environments/describe_environment_spec.rb +0 -89
  49. data/spec/lib/pact_broker/client/environments/update_environment_spec.rb +0 -167
  50. data/spec/lib/pact_broker/client/generate_display_name_spec.rb +0 -39
  51. data/spec/lib/pact_broker/client/git_spec.rb +0 -159
  52. data/spec/lib/pact_broker/client/hal/authorization_header_redactor_spec.rb +0 -17
  53. data/spec/lib/pact_broker/client/hal/entity_spec.rb +0 -149
  54. data/spec/lib/pact_broker/client/hal/http_client_spec.rb +0 -238
  55. data/spec/lib/pact_broker/client/hal/link_spec.rb +0 -127
  56. data/spec/lib/pact_broker/client/matrix/abbreviate_version_number_spec.rb +0 -42
  57. data/spec/lib/pact_broker/client/matrix/resource_spec.rb +0 -70
  58. data/spec/lib/pact_broker/client/matrix/text_formatter_spec.rb +0 -63
  59. data/spec/lib/pact_broker/client/matrix_spec.rb +0 -17
  60. data/spec/lib/pact_broker/client/merge_pacts_spec.rb +0 -198
  61. data/spec/lib/pact_broker/client/pact_broker_client_spec.rb +0 -47
  62. data/spec/lib/pact_broker/client/pacticipants/create_spec.rb +0 -31
  63. data/spec/lib/pact_broker/client/pacticipants_spec.rb +0 -18
  64. data/spec/lib/pact_broker/client/publish_pacts_the_old_way_spec.rb +0 -272
  65. data/spec/lib/pact_broker/client/retry_spec.rb +0 -119
  66. data/spec/lib/pact_broker/client/tasks/publication_task_spec.rb +0 -231
  67. data/spec/lib/pact_broker/client/versions/create_spec.rb +0 -174
  68. data/spec/lib/pact_broker/client/versions/describe_spec.rb +0 -64
  69. data/spec/lib/pact_broker/client/versions_spec.rb +0 -34
  70. data/spec/lib/pact_broker/client/webhooks/create_spec.rb +0 -99
  71. data/spec/lib/pactflow/client/provider_contracts/publish_spec.rb +0 -179
  72. data/spec/pacts/pact_broker_client-pact_broker.json +0 -2969
  73. data/spec/pacts/pact_broker_client-pactflow.json +0 -288
  74. data/spec/readme_spec.rb +0 -16
  75. data/spec/service_providers/create_environment_spec.rb +0 -78
  76. data/spec/service_providers/delete_branch_spec.rb +0 -68
  77. data/spec/service_providers/extra_goodies_spec.rb +0 -108
  78. data/spec/service_providers/list_environments_spec.rb +0 -77
  79. data/spec/service_providers/list_latest_pact_versions_spec.rb.bak +0 -44
  80. data/spec/service_providers/pact_broker_client_matrix_ignore_spec.rb +0 -98
  81. data/spec/service_providers/pact_broker_client_matrix_spec.rb +0 -292
  82. data/spec/service_providers/pact_broker_client_pacticipant_version_spec.rb +0 -56
  83. data/spec/service_providers/pact_broker_client_publish_spec.rb +0 -135
  84. data/spec/service_providers/pact_broker_client_register_repository_spec.rb +0 -49
  85. data/spec/service_providers/pact_broker_client_retrieve_all_pacts_for_provider_spec.rb +0 -53
  86. data/spec/service_providers/pact_broker_client_retrieve_pact_spec.rb +0 -109
  87. data/spec/service_providers/pact_broker_client_tags_spec.rb +0 -101
  88. data/spec/service_providers/pact_broker_client_versions_spec.rb +0 -113
  89. data/spec/service_providers/pact_helper.rb +0 -136
  90. data/spec/service_providers/pactflow_publish_provider_contract_spec.rb +0 -137
  91. data/spec/service_providers/pactflow_publish_provider_contract_the_old_way_spec.rb +0 -129
  92. data/spec/service_providers/pactflow_webhooks_create_spec.rb +0 -86
  93. data/spec/service_providers/pacticipants_create_spec.rb +0 -119
  94. data/spec/service_providers/publish_pacts_spec.rb +0 -114
  95. data/spec/service_providers/record_deployment_spec.rb +0 -199
  96. data/spec/service_providers/record_release_spec.rb +0 -130
  97. data/spec/service_providers/record_undeployment_spec.rb +0 -164
  98. data/spec/service_providers/webhooks_create_spec.rb +0 -391
  99. data/spec/spec_helper.rb +0 -68
  100. data/spec/support/approvals.rb +0 -26
  101. data/spec/support/cli_test_pacts/bar.json +0 -0
  102. data/spec/support/cli_test_pacts/foo.json +0 -0
  103. data/spec/support/latest_pacts_for_provider.json +0 -15
  104. data/spec/support/matrix.json +0 -35
  105. data/spec/support/matrix.txt +0 -3
  106. data/spec/support/matrix_error.txt +0 -3
  107. data/spec/support/matrix_with_results.txt +0 -10
  108. data/spec/support/pacticipant_get.json +0 -18
  109. data/spec/support/pacticipants_list.json +0 -26
  110. data/spec/support/pacts_latest_list.json +0 -41
  111. data/spec/support/shared_context.rb +0 -25
  112. data/spec/support/ssl_server.rb +0 -42
@@ -1,2969 +0,0 @@
1
- {
2
- "consumer": {
3
- "name": "Pact Broker Client"
4
- },
5
- "provider": {
6
- "name": "Pact Broker"
7
- },
8
- "interactions": [
9
- {
10
- "description": "a request for the index resource",
11
- "providerState": "the pb:pacticipant-branch relation exists in the index resource",
12
- "request": {
13
- "method": "GET",
14
- "path": "/",
15
- "headers": {
16
- "Accept": "application/hal+json"
17
- }
18
- },
19
- "response": {
20
- "status": 200,
21
- "headers": {
22
- "Content-Type": "application/hal+json;charset=utf-8"
23
- },
24
- "body": {
25
- "_links": {
26
- "pb:pacticipant-branch": {
27
- "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-BRANCH-{pacticipant}-{branch}"
28
- }
29
- }
30
- },
31
- "matchingRules": {
32
- "$.body._links.pb:pacticipant-branch.href": {
33
- "match": "regex",
34
- "regex": "http:\\/\\/.*{pacticipant}.*{branch}"
35
- }
36
- }
37
- }
38
- },
39
- {
40
- "description": "a request to delete a pacticipant branch",
41
- "providerState": "a branch named main exists for pacticipant Foo",
42
- "request": {
43
- "method": "DELETE",
44
- "path": "/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-BRANCH-Foo-main"
45
- },
46
- "response": {
47
- "status": 204,
48
- "headers": {
49
- }
50
- }
51
- },
52
- {
53
- "description": "a request to list the latest pacts",
54
- "providerState": "a pact between Condor and the Pricing Service exists",
55
- "request": {
56
- "method": "get",
57
- "path": "/pacts/latest",
58
- "headers": {
59
- }
60
- },
61
- "response": {
62
- "status": 200,
63
- "headers": {
64
- "Content-Type": "application/hal+json"
65
- },
66
- "body": {
67
- "_links": {
68
- "self": {
69
- "href": "http://example.org/pacts/latest"
70
- }
71
- },
72
- "pacts": [
73
- {
74
- "_links": {
75
- "self": [
76
- {
77
- "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/latest"
78
- },
79
- {
80
- "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0"
81
- }
82
- ]
83
- },
84
- "_embedded": {
85
- "consumer": {
86
- "name": "Condor",
87
- "_links": {
88
- "self": {
89
- "href": "http://example.org/pacticipants/Condor"
90
- }
91
- },
92
- "_embedded": {
93
- "version": {
94
- "number": "1.3.0"
95
- }
96
- }
97
- },
98
- "provider": {
99
- "_links": {
100
- "self": {
101
- "href": "http://example.org/pacticipants/Pricing%20Service"
102
- }
103
- },
104
- "name": "Pricing Service"
105
- }
106
- }
107
- }
108
- ]
109
- },
110
- "matchingRules": {
111
- "$.headers.Content-Type": {
112
- "match": "regex",
113
- "regex": "application\\/hal\\+json"
114
- }
115
- }
116
- }
117
- },
118
- {
119
- "description": "a request to list pacticipants",
120
- "providerState": "'Condor' exists in the pact-broker",
121
- "request": {
122
- "method": "get",
123
- "path": "/pacticipants",
124
- "headers": {
125
- }
126
- },
127
- "response": {
128
- "status": 200,
129
- "headers": {
130
- "Content-Type": "application/hal+json"
131
- },
132
- "body": {
133
- "_links": {
134
- "self": {
135
- "href": "http://example.org/pacticipants"
136
- },
137
- "pacticipants": [
138
- {
139
- "href": "http://example.org/pacticipants/Condor",
140
- "title": "Condor"
141
- }
142
- ]
143
- },
144
- "pacticipants": [
145
- {
146
- "_links": {
147
- "self": {
148
- "href": "http://example.org/pacticipants/Condor"
149
- }
150
- },
151
- "name": "Condor",
152
- "_embedded": {
153
- "latest-version": {
154
- "_links": {
155
- "self": {
156
- "href": "http://example.org/pacticipants/Condor/versions/1.3.0"
157
- }
158
- },
159
- "number": "1.3.0"
160
- }
161
- }
162
- }
163
- ]
164
- },
165
- "matchingRules": {
166
- "$.headers.Content-Type": {
167
- "match": "regex",
168
- "regex": "application\\/hal\\+json"
169
- }
170
- }
171
- }
172
- },
173
- {
174
- "description": "a request to get the Pricing Service",
175
- "providerState": "the 'Pricing Service' already exists in the pact-broker",
176
- "request": {
177
- "method": "get",
178
- "path": "/pacticipants/Pricing%20Service",
179
- "headers": {
180
- }
181
- },
182
- "response": {
183
- "status": 200,
184
- "headers": {
185
- "Content-Type": "application/hal+json"
186
- },
187
- "body": {
188
- "_links": {
189
- "self": {
190
- "href": "http://example.org/pacticipants/Pricing%20Service"
191
- },
192
- "versions": {
193
- "href": "http://example.org/pacticipants/Pricing%20Service/versions"
194
- }
195
- },
196
- "name": "Pricing Service",
197
- "repositoryUrl": "git@git.realestate.com.au:business-systems/pricing-service",
198
- "_embedded": {
199
- "latest-version": {
200
- "_links": {
201
- "self": {
202
- "href": "http://example.org/pacticipants/Pricing%20Service/versions/1.3.0"
203
- }
204
- },
205
- "number": "1.3.0"
206
- }
207
- }
208
- },
209
- "matchingRules": {
210
- "$.headers.Content-Type": {
211
- "match": "regex",
212
- "regex": "application\\/hal\\+json"
213
- }
214
- }
215
- }
216
- },
217
- {
218
- "description": "a request to get the Pricing Service",
219
- "providerState": "the 'Pricing Service' does not exist in the pact-broker",
220
- "request": {
221
- "method": "get",
222
- "path": "/pacticipants/Pricing%20Service",
223
- "headers": {
224
- }
225
- },
226
- "response": {
227
- "status": 404,
228
- "headers": {
229
- }
230
- }
231
- },
232
- {
233
- "description": "a request to determine if Bar can be deployed with all Foo tagged prod, ignoring the verification for Foo version 3.4.5",
234
- "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",
235
- "request": {
236
- "method": "get",
237
- "path": "/matrix",
238
- "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"
239
- },
240
- "response": {
241
- "status": 200,
242
- "headers": {
243
- "Content-Type": "application/hal+json;charset=utf-8"
244
- },
245
- "body": {
246
- "summary": {
247
- "deployable": true,
248
- "ignored": 1
249
- },
250
- "notices": [
251
- {
252
- "text": "some notice",
253
- "type": "info"
254
- }
255
- ],
256
- "matrix": [
257
- {
258
- "consumer": {
259
- "name": "Foo",
260
- "version": {
261
- "number": "1.2.3"
262
- }
263
- },
264
- "provider": {
265
- "name": "Bar",
266
- "version": {
267
- "number": "4.5.6"
268
- }
269
- },
270
- "verificationResult": {
271
- "success": true,
272
- "_links": {
273
- "self": {
274
- "href": "http://result"
275
- }
276
- }
277
- }
278
- },
279
- {
280
- "consumer": {
281
- "name": "Foo",
282
- "version": {
283
- "number": "3.4.5"
284
- }
285
- },
286
- "provider": {
287
- "name": "Bar",
288
- "version": {
289
- "number": "4.5.6"
290
- }
291
- },
292
- "verificationResult": {
293
- "success": false,
294
- "_links": {
295
- "self": {
296
- "href": "http://result"
297
- }
298
- }
299
- },
300
- "ignored": true
301
- }
302
- ]
303
- },
304
- "matchingRules": {
305
- "$.body.notices": {
306
- "min": 1
307
- },
308
- "$.body.notices[*].*": {
309
- "match": "type"
310
- },
311
- "$.body.matrix[0].verificationResult._links.self.href": {
312
- "match": "type"
313
- },
314
- "$.body.matrix[1].verificationResult._links.self.href": {
315
- "match": "type"
316
- }
317
- }
318
- }
319
- },
320
- {
321
- "description": "a request for the compatibility matrix for Foo version 1.2.3 and Bar version 4.5.6",
322
- "providerState": "the pact for Foo version 1.2.3 has been verified by Bar version 4.5.6",
323
- "request": {
324
- "method": "get",
325
- "path": "/matrix",
326
- "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"
327
- },
328
- "response": {
329
- "status": 200,
330
- "headers": {
331
- "Content-Type": "application/hal+json;charset=utf-8"
332
- },
333
- "body": {
334
- "summary": {
335
- "deployable": true,
336
- "reason": "some text",
337
- "unknown": 1
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
- "_links": {
357
- "self": {
358
- "href": "http://result"
359
- }
360
- }
361
- },
362
- "pact": {
363
- "createdAt": "2017-10-10T12:49:04+11:00"
364
- }
365
- }
366
- ]
367
- },
368
- "matchingRules": {
369
- "$.body": {
370
- "match": "type"
371
- }
372
- }
373
- }
374
- },
375
- {
376
- "description": "a request for the compatibility matrix for Foo version 1.2.3 and Bar version 4.5.6",
377
- "providerState": "the pact for Foo Thing version 1.2.3 has been verified by Bar version 4.5.6",
378
- "request": {
379
- "method": "get",
380
- "path": "/matrix",
381
- "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"
382
- },
383
- "response": {
384
- "status": 200,
385
- "headers": {
386
- "Content-Type": "application/hal+json;charset=utf-8"
387
- },
388
- "body": {
389
- "summary": {
390
- "deployable": true,
391
- "reason": "some text",
392
- "unknown": 1
393
- },
394
- "matrix": [
395
- {
396
- "consumer": {
397
- "name": "Foo",
398
- "version": {
399
- "number": "4"
400
- }
401
- },
402
- "provider": {
403
- "name": "Bar",
404
- "version": {
405
- "number": "5"
406
- }
407
- },
408
- "verificationResult": {
409
- "verifiedAt": "2017-10-10T12:49:04+11:00",
410
- "success": true,
411
- "_links": {
412
- "self": {
413
- "href": "http://result"
414
- }
415
- }
416
- },
417
- "pact": {
418
- "createdAt": "2017-10-10T12:49:04+11:00"
419
- }
420
- }
421
- ]
422
- },
423
- "matchingRules": {
424
- "$.body": {
425
- "match": "type"
426
- }
427
- }
428
- }
429
- },
430
- {
431
- "description": "a request for the compatibility matrix where only the version of Foo is specified",
432
- "providerState": "the pact for Foo version 1.2.3 has been verified by Bar version 4.5.6 and version 5.6.7",
433
- "request": {
434
- "method": "get",
435
- "path": "/matrix",
436
- "query": "q%5B%5D%5Bpacticipant%5D=Foo&q%5B%5D%5Bversion%5D=1.2.3&latestby=cvp&latest=true"
437
- },
438
- "response": {
439
- "status": 200,
440
- "headers": {
441
- "Content-Type": "application/hal+json;charset=utf-8"
442
- },
443
- "body": {
444
- "summary": {
445
- "deployable": true,
446
- "reason": "some text",
447
- "unknown": 1
448
- },
449
- "matrix": [
450
- {
451
- "consumer": {
452
- "name": "Foo",
453
- "version": {
454
- "number": "4"
455
- }
456
- },
457
- "provider": {
458
- "name": "Bar",
459
- "version": {
460
- "number": "5"
461
- }
462
- },
463
- "verificationResult": {
464
- "verifiedAt": "2017-10-10T12:49:04+11:00",
465
- "success": true,
466
- "_links": {
467
- "self": {
468
- "href": "http://result"
469
- }
470
- }
471
- },
472
- "pact": {
473
- "createdAt": "2017-10-10T12:49:04+11:00"
474
- }
475
- }
476
- ]
477
- },
478
- "matchingRules": {
479
- "$.body": {
480
- "match": "type"
481
- }
482
- }
483
- }
484
- },
485
- {
486
- "description": "a request for the compatibility matrix where one or more versions does not exist",
487
- "providerState": "the pact for Foo version 1.2.3 has been verified by Bar version 4.5.6",
488
- "request": {
489
- "method": "get",
490
- "path": "/matrix",
491
- "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"
492
- },
493
- "response": {
494
- "status": 200,
495
- "headers": {
496
- "Content-Type": "application/hal+json;charset=utf-8"
497
- },
498
- "body": {
499
- "summary": {
500
- "reason": "an error message"
501
- }
502
- },
503
- "matchingRules": {
504
- "$.body.summary.reason": {
505
- "match": "type"
506
- }
507
- }
508
- }
509
- },
510
- {
511
- "description": "a request for the compatibility matrix for a pacticipant that does not exist",
512
- "request": {
513
- "method": "get",
514
- "path": "/matrix",
515
- "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"
516
- },
517
- "response": {
518
- "status": 400,
519
- "headers": {
520
- "Content-Type": "application/hal+json;charset=utf-8"
521
- },
522
- "body": {
523
- "errors": [
524
- "an error message"
525
- ]
526
- },
527
- "matchingRules": {
528
- "$.body.errors": {
529
- "min": 1
530
- },
531
- "$.body.errors[*].*": {
532
- "match": "type"
533
- }
534
- }
535
- }
536
- },
537
- {
538
- "description": "a request for the compatibility matrix for all versions of Foo and Bar",
539
- "providerState": "the pact for Foo version 1.2.3 and 1.2.4 has been verified by Bar version 4.5.6",
540
- "request": {
541
- "method": "get",
542
- "path": "/matrix",
543
- "query": "q%5B%5D%5Bpacticipant%5D=Foo&q%5B%5D%5Bpacticipant%5D=Bar&latestby=cvpv"
544
- },
545
- "response": {
546
- "status": 200,
547
- "headers": {
548
- "Content-Type": "application/hal+json;charset=utf-8"
549
- },
550
- "body": {
551
- "matrix": [
552
- {
553
- "consumer": {
554
- "name": "Foo",
555
- "version": {
556
- "number": "4"
557
- }
558
- },
559
- "provider": {
560
- "name": "Bar",
561
- "version": {
562
- "number": "5"
563
- }
564
- },
565
- "verificationResult": {
566
- "verifiedAt": "2017-10-10T12:49:04+11:00",
567
- "success": true,
568
- "_links": {
569
- "self": {
570
- "href": "http://result"
571
- }
572
- }
573
- },
574
- "pact": {
575
- "createdAt": "2017-10-10T12:49:04+11:00"
576
- }
577
- },
578
- {
579
- "consumer": {
580
- "name": "Foo",
581
- "version": {
582
- "number": "4"
583
- }
584
- },
585
- "provider": {
586
- "name": "Bar",
587
- "version": {
588
- "number": "5"
589
- }
590
- },
591
- "verificationResult": {
592
- "verifiedAt": "2017-10-10T12:49:04+11:00",
593
- "success": true,
594
- "_links": {
595
- "self": {
596
- "href": "http://result"
597
- }
598
- }
599
- },
600
- "pact": {
601
- "createdAt": "2017-10-10T12:49:04+11:00"
602
- }
603
- }
604
- ]
605
- },
606
- "matchingRules": {
607
- "$.body.matrix": {
608
- "min": 2
609
- },
610
- "$.body.matrix[*].*": {
611
- "match": "type"
612
- }
613
- }
614
- }
615
- },
616
- {
617
- "description": "a request for the successful rows of the compatibility matrix for all versions of Foo and Bar",
618
- "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",
619
- "request": {
620
- "method": "get",
621
- "path": "/matrix",
622
- "query": "q%5B%5D%5Bpacticipant%5D=Foo&q%5B%5D%5Bpacticipant%5D=Bar&latestby=cvpv&success%5B%5D=true"
623
- },
624
- "response": {
625
- "status": 200,
626
- "headers": {
627
- "Content-Type": "application/hal+json;charset=utf-8"
628
- },
629
- "body": {
630
- "summary": {
631
- "deployable": true,
632
- "reason": "some text",
633
- "unknown": 1
634
- },
635
- "matrix": [
636
- {
637
- "consumer": {
638
- "name": "Foo",
639
- "version": {
640
- "number": "4"
641
- }
642
- },
643
- "provider": {
644
- "name": "Bar",
645
- "version": {
646
- "number": "5"
647
- }
648
- },
649
- "verificationResult": {
650
- "verifiedAt": "2017-10-10T12:49:04+11:00",
651
- "success": true,
652
- "_links": {
653
- "self": {
654
- "href": "http://result"
655
- }
656
- }
657
- },
658
- "pact": {
659
- "createdAt": "2017-10-10T12:49:04+11:00"
660
- }
661
- }
662
- ]
663
- },
664
- "matchingRules": {
665
- "$.body": {
666
- "match": "type"
667
- }
668
- }
669
- }
670
- },
671
- {
672
- "description": "a request for the compatibility matrix for Foo version 1.2.3 and the latest prod version of Bar",
673
- "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",
674
- "request": {
675
- "method": "get",
676
- "path": "/matrix",
677
- "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"
678
- },
679
- "response": {
680
- "status": 200,
681
- "headers": {
682
- "Content-Type": "application/hal+json;charset=utf-8"
683
- },
684
- "body": {
685
- "summary": {
686
- "deployable": true,
687
- "reason": "some text",
688
- "unknown": 1
689
- },
690
- "matrix": [
691
- {
692
- "consumer": {
693
- "name": "Foo",
694
- "version": {
695
- "number": "4"
696
- }
697
- },
698
- "provider": {
699
- "name": "Bar",
700
- "version": {
701
- "number": "5"
702
- }
703
- },
704
- "verificationResult": {
705
- "verifiedAt": "2017-10-10T12:49:04+11:00",
706
- "success": true,
707
- "_links": {
708
- "self": {
709
- "href": "http://result"
710
- }
711
- }
712
- },
713
- "pact": {
714
- "createdAt": "2017-10-10T12:49:04+11:00"
715
- }
716
- }
717
- ]
718
- },
719
- "matchingRules": {
720
- "$.body": {
721
- "match": "type"
722
- }
723
- }
724
- }
725
- },
726
- {
727
- "description": "a request for the compatibility matrix for Foo version 1.2.3 and the latest version of Bar",
728
- "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",
729
- "request": {
730
- "method": "get",
731
- "path": "/matrix",
732
- "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"
733
- },
734
- "response": {
735
- "status": 200,
736
- "headers": {
737
- "Content-Type": "application/hal+json;charset=utf-8"
738
- },
739
- "body": {
740
- "summary": {
741
- "deployable": true,
742
- "reason": "some text",
743
- "unknown": 1
744
- },
745
- "matrix": [
746
- {
747
- "consumer": {
748
- "name": "Foo",
749
- "version": {
750
- "number": "4"
751
- }
752
- },
753
- "provider": {
754
- "name": "Bar",
755
- "version": {
756
- "number": "5"
757
- }
758
- },
759
- "verificationResult": {
760
- "verifiedAt": "2017-10-10T12:49:04+11:00",
761
- "success": true,
762
- "_links": {
763
- "self": {
764
- "href": "http://result"
765
- }
766
- }
767
- },
768
- "pact": {
769
- "createdAt": "2017-10-10T12:49:04+11:00"
770
- }
771
- }
772
- ]
773
- },
774
- "matchingRules": {
775
- "$.body": {
776
- "match": "type"
777
- }
778
- }
779
- }
780
- },
781
- {
782
- "description": "a request for the compatibility matrix for Foo version 1.2.3 and the latest prod versions of all other pacticipants",
783
- "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",
784
- "request": {
785
- "method": "get",
786
- "path": "/matrix",
787
- "query": "q%5B%5D%5Bpacticipant%5D=Foo&q%5B%5D%5Bversion%5D=1.2.3&latestby=cvp&latest=true&tag=prod"
788
- },
789
- "response": {
790
- "status": 200,
791
- "headers": {
792
- "Content-Type": "application/hal+json;charset=utf-8"
793
- },
794
- "body": {
795
- "matrix": [
796
- {
797
- "consumer": {
798
- "name": "Foo",
799
- "version": {
800
- "number": "1.2.3"
801
- }
802
- },
803
- "provider": {
804
- "name": "Bar",
805
- "version": {
806
- "number": "4.5.6"
807
- }
808
- }
809
- }
810
- ]
811
- }
812
- }
813
- },
814
- {
815
- "description": "a request to publish a pact",
816
- "providerState": "the 'Pricing Service' already exists in the pact-broker",
817
- "request": {
818
- "method": "put",
819
- "path": "/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0",
820
- "headers": {
821
- "Content-Type": "application/json"
822
- },
823
- "body": {
824
- "consumer": {
825
- "name": "Condor"
826
- },
827
- "provider": {
828
- "name": "Pricing Service"
829
- },
830
- "interactions": [
831
-
832
- ]
833
- }
834
- },
835
- "response": {
836
- "status": 201,
837
- "headers": {
838
- "Content-Type": "application/hal+json;charset=utf-8"
839
- },
840
- "body": {
841
- "_links": {
842
- "pb:latest-pact-version": {
843
- "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/latest"
844
- }
845
- }
846
- }
847
- }
848
- },
849
- {
850
- "description": "a request to publish a pact with method patch",
851
- "providerState": "the 'Pricing Service' and 'Condor' already exist in the pact-broker, and Condor already has a pact published for version 1.3.0",
852
- "request": {
853
- "method": "patch",
854
- "path": "/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0",
855
- "headers": {
856
- "Content-Type": "application/json"
857
- },
858
- "body": {
859
- "consumer": {
860
- "name": "Condor"
861
- },
862
- "provider": {
863
- "name": "Pricing Service"
864
- },
865
- "interactions": [
866
-
867
- ]
868
- }
869
- },
870
- "response": {
871
- "status": 200,
872
- "headers": {
873
- "Content-Type": "application/hal+json;charset=utf-8"
874
- },
875
- "body": {
876
- "_links": {
877
- "pb:latest-pact-version": {
878
- "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/latest"
879
- }
880
- }
881
- }
882
- }
883
- },
884
- {
885
- "description": "a request to publish a pact with method put",
886
- "providerState": "the 'Pricing Service' and 'Condor' already exist in the pact-broker, and Condor already has a pact published for version 1.3.0",
887
- "request": {
888
- "method": "put",
889
- "path": "/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0",
890
- "headers": {
891
- "Content-Type": "application/json"
892
- },
893
- "body": {
894
- "consumer": {
895
- "name": "Condor"
896
- },
897
- "provider": {
898
- "name": "Pricing Service"
899
- },
900
- "interactions": [
901
-
902
- ]
903
- }
904
- },
905
- "response": {
906
- "status": 200,
907
- "headers": {
908
- "Content-Type": "application/hal+json;charset=utf-8"
909
- },
910
- "body": {
911
- "_links": {
912
- "pb:latest-pact-version": {
913
- "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/latest"
914
- }
915
- }
916
- }
917
- }
918
- },
919
- {
920
- "description": "a request to publish a pact",
921
- "providerState": "'Condor' already exist in the pact-broker, but the 'Pricing Service' does not",
922
- "request": {
923
- "method": "put",
924
- "path": "/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0",
925
- "headers": {
926
- "Content-Type": "application/json"
927
- },
928
- "body": {
929
- "consumer": {
930
- "name": "Condor"
931
- },
932
- "provider": {
933
- "name": "Pricing Service"
934
- },
935
- "interactions": [
936
-
937
- ]
938
- }
939
- },
940
- "response": {
941
- "status": 201,
942
- "headers": {
943
- "Content-Type": "application/hal+json;charset=utf-8"
944
- },
945
- "body": {
946
- "_links": {
947
- "pb:latest-pact-version": {
948
- "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/latest"
949
- }
950
- }
951
- }
952
- }
953
- },
954
- {
955
- "description": "a request to publish a pact",
956
- "providerState": "an error occurs while publishing a pact",
957
- "request": {
958
- "method": "put",
959
- "path": "/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0",
960
- "headers": {
961
- "Content-Type": "application/json"
962
- },
963
- "body": {
964
- "consumer": {
965
- "name": "Condor"
966
- },
967
- "provider": {
968
- "name": "Pricing Service"
969
- },
970
- "interactions": [
971
-
972
- ]
973
- }
974
- },
975
- "response": {
976
- "status": 500,
977
- "headers": {
978
- "Content-Type": "application/hal+json"
979
- },
980
- "body": {
981
- "error": {
982
- "message": "An error occurred"
983
- }
984
- },
985
- "matchingRules": {
986
- "$.headers.Content-Type": {
987
- "match": "regex",
988
- "regex": "application\\/.*json"
989
- },
990
- "$.body.error.message": {
991
- "match": "regex",
992
- "regex": ".*"
993
- }
994
- }
995
- }
996
- },
997
- {
998
- "description": "a request to register the repository URL of a pacticipant",
999
- "providerState": "the 'Pricing Service' does not exist in the pact-broker",
1000
- "request": {
1001
- "method": "patch",
1002
- "path": "/pacticipants/Pricing%20Service",
1003
- "headers": {
1004
- "Content-Type": "application/json"
1005
- },
1006
- "body": {
1007
- "repository_url": "git@git.realestate.com.au:business-systems/pricing-service"
1008
- }
1009
- },
1010
- "response": {
1011
- "status": 201,
1012
- "headers": {
1013
- "Content-Type": "application/hal+json;charset=utf-8"
1014
- }
1015
- }
1016
- },
1017
- {
1018
- "description": "a request to register the repository URL of a pacticipant",
1019
- "providerState": "the 'Pricing Service' already exists in the pact-broker",
1020
- "request": {
1021
- "method": "patch",
1022
- "path": "/pacticipants/Pricing%20Service",
1023
- "headers": {
1024
- "Content-Type": "application/json"
1025
- },
1026
- "body": {
1027
- "repository_url": "git@git.realestate.com.au:business-systems/pricing-service"
1028
- }
1029
- },
1030
- "response": {
1031
- "status": 200,
1032
- "headers": {
1033
- "Content-Type": "application/hal+json;charset=utf-8"
1034
- }
1035
- }
1036
- },
1037
- {
1038
- "description": "a request for the list of the latest prod pacts from all consumers for the Pricing Service'",
1039
- "providerState": "tagged as prod pact between Condor and the Pricing Service exists",
1040
- "request": {
1041
- "method": "get",
1042
- "path": "/pacts/provider/Pricing%20Service/latest/prod",
1043
- "headers": {
1044
- }
1045
- },
1046
- "response": {
1047
- "status": 200,
1048
- "headers": {
1049
- },
1050
- "body": {
1051
- "_links": {
1052
- "provider": {
1053
- "href": "http://example.org/pacticipants/Pricing%20Service",
1054
- "title": "Pricing Service"
1055
- },
1056
- "pb:pacts": [
1057
- {
1058
- "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0",
1059
- "title": "Pact between Condor (v1.3.0) and Pricing Service",
1060
- "name": "Condor"
1061
- }
1062
- ]
1063
- }
1064
- },
1065
- "matchingRules": {
1066
- "$.body": {
1067
- "match": "type"
1068
- }
1069
- }
1070
- }
1071
- },
1072
- {
1073
- "description": "a request for the list of the latest pacts from all consumers for the Pricing Service'",
1074
- "providerState": "a latest pact between Condor and the Pricing Service exists",
1075
- "request": {
1076
- "method": "get",
1077
- "path": "/pacts/provider/Pricing%20Service/latest",
1078
- "headers": {
1079
- }
1080
- },
1081
- "response": {
1082
- "status": 200,
1083
- "headers": {
1084
- },
1085
- "body": {
1086
- "_links": {
1087
- "provider": {
1088
- "href": "http://example.org/pacticipants/Pricing%20Service",
1089
- "title": "Pricing Service"
1090
- },
1091
- "pb:pacts": [
1092
- {
1093
- "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0",
1094
- "title": "Pact between Condor (v1.3.0) and Pricing Service",
1095
- "name": "Condor"
1096
- }
1097
- ]
1098
- }
1099
- },
1100
- "matchingRules": {
1101
- "$.body": {
1102
- "match": "type"
1103
- }
1104
- }
1105
- }
1106
- },
1107
- {
1108
- "description": "a request retrieve a pact for a specific version",
1109
- "providerState": "the 'Pricing Service' and 'Condor' already exist in the pact-broker, and Condor already has a pact published for version 1.3.0",
1110
- "request": {
1111
- "method": "get",
1112
- "path": "/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0",
1113
- "headers": {
1114
- }
1115
- },
1116
- "response": {
1117
- "status": 200,
1118
- "headers": {
1119
- "Content-Type": "application/hal+json;charset=utf-8"
1120
- },
1121
- "body": {
1122
- "consumer": {
1123
- "name": "Condor"
1124
- },
1125
- "provider": {
1126
- "name": "Pricing Service"
1127
- },
1128
- "interactions": [
1129
-
1130
- ]
1131
- }
1132
- }
1133
- },
1134
- {
1135
- "description": "a request to retrieve the latest pact between Condor and the Pricing Service",
1136
- "providerState": "a pact between Condor and the Pricing Service exists",
1137
- "request": {
1138
- "method": "get",
1139
- "path": "/pacts/provider/Pricing%20Service/consumer/Condor/latest",
1140
- "headers": {
1141
- }
1142
- },
1143
- "response": {
1144
- "status": 200,
1145
- "headers": {
1146
- "Content-Type": "application/hal+json",
1147
- "X-Pact-Consumer-Version": "1.3.0"
1148
- },
1149
- "body": {
1150
- "consumer": {
1151
- "name": "Condor"
1152
- },
1153
- "provider": {
1154
- "name": "Pricing Service"
1155
- },
1156
- "interactions": [
1157
-
1158
- ]
1159
- },
1160
- "matchingRules": {
1161
- "$.headers.Content-Type": {
1162
- "match": "regex",
1163
- "regex": "application\\/.*json"
1164
- }
1165
- }
1166
- }
1167
- },
1168
- {
1169
- "description": "a request to retrieve the latest pact between Condor and the Pricing Service",
1170
- "providerState": "no pact between Condor and the Pricing Service exists",
1171
- "request": {
1172
- "method": "get",
1173
- "path": "/pacts/provider/Pricing%20Service/consumer/Condor/latest",
1174
- "headers": {
1175
- }
1176
- },
1177
- "response": {
1178
- "status": 404,
1179
- "headers": {
1180
- }
1181
- }
1182
- },
1183
- {
1184
- "description": "a request to retrieve the pact between the production verison of Condor and the Pricing Service",
1185
- "providerState": "a pact between Condor and the Pricing Service exists for the production version of Condor",
1186
- "request": {
1187
- "method": "get",
1188
- "path": "/pacts/provider/Pricing%20Service/consumer/Condor/latest/prod",
1189
- "headers": {
1190
- "Accept": "application/hal+json, application/json"
1191
- }
1192
- },
1193
- "response": {
1194
- "status": 200,
1195
- "headers": {
1196
- "Content-Type": "application/hal+json;charset=utf-8"
1197
- },
1198
- "body": {
1199
- "consumer": {
1200
- "name": "Condor"
1201
- },
1202
- "provider": {
1203
- "name": "Pricing Service"
1204
- },
1205
- "interactions": [
1206
-
1207
- ]
1208
- }
1209
- }
1210
- },
1211
- {
1212
- "description": "a request to tag the production version of Condor",
1213
- "providerState": "'Condor' exists in the pact-broker",
1214
- "request": {
1215
- "method": "put",
1216
- "path": "/pacticipants/Condor/versions/1.3.0/tags/prod",
1217
- "headers": {
1218
- "Content-Type": "application/json"
1219
- }
1220
- },
1221
- "response": {
1222
- "status": 201,
1223
- "headers": {
1224
- "Content-Type": "application/hal+json;charset=utf-8"
1225
- },
1226
- "body": {
1227
- "_links": {
1228
- "self": {
1229
- "href": "http://localhost:1234/pacticipants/Condor/versions/1.3.0/tags/prod"
1230
- }
1231
- }
1232
- },
1233
- "matchingRules": {
1234
- "$.body._links.self.href": {
1235
- "match": "regex",
1236
- "regex": "http:\\/\\/.*\\/pacticipants\\/Condor\\/versions\\/1.3.0\\/tags\\/prod"
1237
- }
1238
- }
1239
- }
1240
- },
1241
- {
1242
- "description": "a request to tag the production version of Condor",
1243
- "providerState": "'Condor' does not exist in the pact-broker",
1244
- "request": {
1245
- "method": "put",
1246
- "path": "/pacticipants/Condor/versions/1.3.0/tags/prod",
1247
- "headers": {
1248
- "Content-Type": "application/json"
1249
- }
1250
- },
1251
- "response": {
1252
- "status": 201,
1253
- "headers": {
1254
- "Content-Type": "application/hal+json;charset=utf-8"
1255
- },
1256
- "body": {
1257
- "_links": {
1258
- "self": {
1259
- "href": "http://localhost:1234/pacticipants/Condor/versions/1.3.0/tags/prod"
1260
- }
1261
- }
1262
- },
1263
- "matchingRules": {
1264
- "$.body._links.self.href": {
1265
- "match": "regex",
1266
- "regex": "http:\\/\\/.*\\/pacticipants\\/Condor\\/versions\\/1.3.0\\/tags\\/prod"
1267
- }
1268
- }
1269
- }
1270
- },
1271
- {
1272
- "description": "a request to tag the production version of Condor",
1273
- "providerState": "'Condor' exists in the pact-broker with version 1.3.0, tagged with 'prod'",
1274
- "request": {
1275
- "method": "put",
1276
- "path": "/pacticipants/Condor/versions/1.3.0/tags/prod",
1277
- "headers": {
1278
- "Content-Type": "application/json"
1279
- }
1280
- },
1281
- "response": {
1282
- "status": 200,
1283
- "headers": {
1284
- "Content-Type": "application/hal+json;charset=utf-8"
1285
- },
1286
- "body": {
1287
- "_links": {
1288
- "self": {
1289
- "href": "http://localhost:1234/pacticipants/Condor/versions/1.3.0/tags/prod"
1290
- }
1291
- }
1292
- },
1293
- "matchingRules": {
1294
- "$.body._links.self.href": {
1295
- "match": "regex",
1296
- "regex": "http:\\/\\/.*\\/pacticipants\\/Condor\\/versions\\/1.3.0\\/tags\\/prod"
1297
- }
1298
- }
1299
- }
1300
- },
1301
- {
1302
- "description": "a request for the index resource",
1303
- "providerState": "the pb:latest-version relation exists in the index resource",
1304
- "request": {
1305
- "method": "get",
1306
- "path": "/",
1307
- "headers": {
1308
- "Accept": "application/hal+json, application/json"
1309
- }
1310
- },
1311
- "response": {
1312
- "status": 200,
1313
- "headers": {
1314
- "Content-Type": "application/hal+json;charset=utf-8"
1315
- },
1316
- "body": {
1317
- "_links": {
1318
- "pb:latest-version": {
1319
- "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-INDEX-PB-LATEST-VERSION-{pacticipant}"
1320
- }
1321
- }
1322
- },
1323
- "matchingRules": {
1324
- "$.body._links.pb:latest-version.href": {
1325
- "match": "regex",
1326
- "regex": "http:\\/\\/.*{pacticipant}"
1327
- }
1328
- }
1329
- }
1330
- },
1331
- {
1332
- "description": "a request to retrieve the latest version of Condor",
1333
- "providerState": "'Condor' exists in the pact-broker with the latest version 1.2.3",
1334
- "request": {
1335
- "method": "get",
1336
- "path": "/HAL-REL-PLACEHOLDER-INDEX-PB-LATEST-VERSION-Condor",
1337
- "headers": {
1338
- "Accept": "application/hal+json, application/json"
1339
- }
1340
- },
1341
- "response": {
1342
- "status": 200,
1343
- "headers": {
1344
- "Content-Type": "application/hal+json;charset=utf-8"
1345
- },
1346
- "body": {
1347
- "number": "1.2.3",
1348
- "_links": {
1349
- "self": {
1350
- "href": "http://localhost:1234/some-url"
1351
- }
1352
- }
1353
- },
1354
- "matchingRules": {
1355
- "$.body._links.self.href": {
1356
- "match": "regex",
1357
- "regex": "http:\\/\\/.*"
1358
- }
1359
- }
1360
- }
1361
- },
1362
- {
1363
- "description": "a request for the index resource",
1364
- "providerState": "the pb:latest-tagged-version relation exists in the index resource",
1365
- "request": {
1366
- "method": "get",
1367
- "path": "/",
1368
- "headers": {
1369
- "Accept": "application/hal+json, application/json"
1370
- }
1371
- },
1372
- "response": {
1373
- "status": 200,
1374
- "headers": {
1375
- "Content-Type": "application/hal+json;charset=utf-8"
1376
- },
1377
- "body": {
1378
- "_links": {
1379
- "pb:latest-tagged-version": {
1380
- "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-INDEX-PB-LATEST-TAGGED-VERSION-{pacticipant}-{tag}"
1381
- }
1382
- }
1383
- },
1384
- "matchingRules": {
1385
- "$.body._links.pb:latest-tagged-version.href": {
1386
- "match": "regex",
1387
- "regex": "http:\\/\\/.*{pacticipant}.*{tag}"
1388
- }
1389
- }
1390
- }
1391
- },
1392
- {
1393
- "description": "a request to retrieve the latest 'production' version of Condor",
1394
- "providerState": "'Condor' exists in the pact-broker with the latest tagged 'production' version 1.2.3",
1395
- "request": {
1396
- "method": "get",
1397
- "path": "/HAL-REL-PLACEHOLDER-INDEX-PB-LATEST-TAGGED-VERSION-Condor-production",
1398
- "headers": {
1399
- "Accept": "application/hal+json, application/json"
1400
- }
1401
- },
1402
- "response": {
1403
- "status": 200,
1404
- "headers": {
1405
- "Content-Type": "application/hal+json;charset=utf-8"
1406
- },
1407
- "body": {
1408
- "number": "1.2.3",
1409
- "_links": {
1410
- "self": {
1411
- "href": "http://localhost:1234/some-url"
1412
- }
1413
- }
1414
- },
1415
- "matchingRules": {
1416
- "$.body._links.self.href": {
1417
- "match": "regex",
1418
- "regex": "http:\\/\\/.*"
1419
- }
1420
- }
1421
- }
1422
- },
1423
- {
1424
- "description": "a request for the index resource",
1425
- "providerState": "the pacticipant relations are present",
1426
- "request": {
1427
- "method": "get",
1428
- "path": "/",
1429
- "headers": {
1430
- "Accept": "application/hal+json"
1431
- }
1432
- },
1433
- "response": {
1434
- "status": 200,
1435
- "headers": {
1436
- "Content-Type": "application/hal+json;charset=utf-8"
1437
- },
1438
- "body": {
1439
- "_links": {
1440
- "pb:pacticipants": {
1441
- "href": "http://localhost:1234/pacticipants"
1442
- },
1443
- "pb:pacticipant": {
1444
- "href": "http://localhost:1234/pacticipants/{pacticipant}"
1445
- }
1446
- }
1447
- },
1448
- "matchingRules": {
1449
- "$.body._links.pb:pacticipants.href": {
1450
- "match": "regex",
1451
- "regex": "http:\\/\\/.*"
1452
- },
1453
- "$.body._links.pb:pacticipant.href": {
1454
- "match": "regex",
1455
- "regex": "http:\\/\\/.*\\{pacticipant\\}"
1456
- }
1457
- }
1458
- }
1459
- },
1460
- {
1461
- "description": "a request to retrieve a pacticipant",
1462
- "request": {
1463
- "method": "get",
1464
- "path": "/pacticipants/Foo",
1465
- "headers": {
1466
- "Accept": "application/hal+json"
1467
- }
1468
- },
1469
- "response": {
1470
- "status": 404,
1471
- "headers": {
1472
- }
1473
- }
1474
- },
1475
- {
1476
- "description": "a request to create a pacticipant",
1477
- "request": {
1478
- "method": "post",
1479
- "path": "/pacticipants",
1480
- "headers": {
1481
- "Content-Type": "application/json",
1482
- "Accept": "application/hal+json"
1483
- },
1484
- "body": {
1485
- "name": "Foo",
1486
- "repositoryUrl": "http://foo"
1487
- }
1488
- },
1489
- "response": {
1490
- "status": 201,
1491
- "headers": {
1492
- "Content-Type": "application/hal+json;charset=utf-8"
1493
- },
1494
- "body": {
1495
- "name": "Foo",
1496
- "repositoryUrl": "http://foo",
1497
- "_links": {
1498
- "self": {
1499
- "href": "http://localhost:1234/pacticipants/Foo"
1500
- }
1501
- }
1502
- },
1503
- "matchingRules": {
1504
- "$.body._links.self.href": {
1505
- "match": "regex",
1506
- "regex": "http:\\/\\/.*"
1507
- }
1508
- }
1509
- }
1510
- },
1511
- {
1512
- "description": "a request to retrieve a pacticipant",
1513
- "providerState": "a pacticipant with name Foo exists",
1514
- "request": {
1515
- "method": "get",
1516
- "path": "/pacticipants/Foo",
1517
- "headers": {
1518
- "Accept": "application/hal+json"
1519
- }
1520
- },
1521
- "response": {
1522
- "status": 200,
1523
- "headers": {
1524
- "Content-Type": "application/hal+json;charset=utf-8"
1525
- },
1526
- "body": {
1527
- "_links": {
1528
- "self": {
1529
- "href": "http://localhost:1234/pacticipants/Foo"
1530
- }
1531
- }
1532
- },
1533
- "matchingRules": {
1534
- "$.body._links.self.href": {
1535
- "match": "regex",
1536
- "regex": "http:\\/\\/.*"
1537
- }
1538
- }
1539
- }
1540
- },
1541
- {
1542
- "description": "a request to update a pacticipant",
1543
- "providerState": "a pacticipant with name Foo exists",
1544
- "request": {
1545
- "method": "patch",
1546
- "path": "/pacticipants/Foo",
1547
- "headers": {
1548
- "Content-Type": "application/json",
1549
- "Accept": "application/hal+json"
1550
- },
1551
- "body": {
1552
- "name": "Foo",
1553
- "repositoryUrl": "http://foo"
1554
- }
1555
- },
1556
- "response": {
1557
- "status": 200,
1558
- "headers": {
1559
- "Content-Type": "application/hal+json;charset=utf-8"
1560
- },
1561
- "body": {
1562
- "name": "Foo",
1563
- "repositoryUrl": "http://foo",
1564
- "_links": {
1565
- "self": {
1566
- "href": "http://localhost:1234/pacticipants/Foo"
1567
- }
1568
- }
1569
- },
1570
- "matchingRules": {
1571
- "$.body._links.self.href": {
1572
- "match": "regex",
1573
- "regex": "http:\\/\\/.*"
1574
- }
1575
- }
1576
- }
1577
- },
1578
- {
1579
- "description": "a request for the index resource",
1580
- "providerState": "the pb:publish-contracts relations exists in the index resource",
1581
- "request": {
1582
- "method": "GET",
1583
- "path": "/",
1584
- "headers": {
1585
- "Accept": "application/hal+json"
1586
- }
1587
- },
1588
- "response": {
1589
- "status": 200,
1590
- "headers": {
1591
- "Content-Type": "application/hal+json;charset=utf-8"
1592
- },
1593
- "body": {
1594
- "_links": {
1595
- "pb:publish-contracts": {
1596
- "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-PUBLISH-CONTRACTS"
1597
- }
1598
- }
1599
- },
1600
- "matchingRules": {
1601
- "$.body._links.pb:publish-contracts.href": {
1602
- "match": "regex",
1603
- "regex": "http:\\/\\/.*"
1604
- }
1605
- }
1606
- }
1607
- },
1608
- {
1609
- "description": "a request to publish contracts",
1610
- "request": {
1611
- "method": "POST",
1612
- "path": "/HAL-REL-PLACEHOLDER-PB-PUBLISH-CONTRACTS",
1613
- "headers": {
1614
- "Content-Type": "application/json",
1615
- "Accept": "application/hal+json"
1616
- },
1617
- "body": {
1618
- "pacticipantName": "Foo",
1619
- "pacticipantVersionNumber": "5556b8149bf8bac76bc30f50a8a2dd4c22c85f30",
1620
- "branch": "main",
1621
- "tags": [
1622
- "dev"
1623
- ],
1624
- "buildUrl": "http://build",
1625
- "contracts": [
1626
- {
1627
- "consumerName": "Foo",
1628
- "providerName": "Bar",
1629
- "specification": "pact",
1630
- "contentType": "application/json",
1631
- "content": "eyJjb25zdW1lciI6eyJuYW1lIjoiRm9vIn0sInByb3ZpZGVyIjp7Im5hbWUiOiJCYXIifSwiaW50ZXJhY3Rpb25zIjpbeyJkZXNjcmlwdGlvbiI6ImFuIGV4YW1wbGUgcmVxdWVzdCIsInByb3ZpZGVyU3RhdGUiOiJhIHByb3ZpZGVyIHN0YXRlIiwicmVxdWVzdCI6eyJtZXRob2QiOiJHRVQiLCJwYXRoIjoiLyIsImhlYWRlcnMiOnt9fSwicmVzcG9uc2UiOnsic3RhdHVzIjoyMDAsImhlYWRlcnMiOnsiQ29udGVudC1UeXBlIjoiYXBwbGljYXRpb24vaGFsK2pzb24ifX19XSwibWV0YWRhdGEiOnsicGFjdFNwZWNpZmljYXRpb24iOnsidmVyc2lvbiI6IjIuMC4wIn19fQ==",
1632
- "onConflict": "merge"
1633
- }
1634
- ]
1635
- }
1636
- },
1637
- "response": {
1638
- "status": 200,
1639
- "headers": {
1640
- "Content-Type": "application/hal+json;charset=utf-8"
1641
- },
1642
- "body": {
1643
- "_embedded": {
1644
- "pacticipant": {
1645
- "name": "Foo"
1646
- },
1647
- "version": {
1648
- "number": "5556b8149bf8bac76bc30f50a8a2dd4c22c85f30"
1649
- }
1650
- },
1651
- "logs": [
1652
- {
1653
- "level": "info",
1654
- "message": "some message"
1655
- }
1656
- ],
1657
- "_links": {
1658
- "pb:pacticipant-version-tags": [
1659
- {
1660
- "name": "dev"
1661
- }
1662
- ],
1663
- "pb:contracts": [
1664
- {
1665
- "href": "http://some-pact"
1666
- }
1667
- ]
1668
- }
1669
- },
1670
- "matchingRules": {
1671
- "$.body.logs": {
1672
- "min": 1
1673
- },
1674
- "$.body.logs[*].*": {
1675
- "match": "type"
1676
- },
1677
- "$.body._links.pb:contracts[0].href": {
1678
- "match": "type"
1679
- }
1680
- }
1681
- }
1682
- },
1683
- {
1684
- "description": "a request for the index resource",
1685
- "providerState": "the pb:pacticipant-version and pb:environments relations exist in the index resource",
1686
- "request": {
1687
- "method": "GET",
1688
- "path": "/",
1689
- "headers": {
1690
- "Accept": "application/hal+json"
1691
- }
1692
- },
1693
- "response": {
1694
- "status": 200,
1695
- "headers": {
1696
- "Content-Type": "application/hal+json;charset=utf-8"
1697
- },
1698
- "body": {
1699
- "_links": {
1700
- "pb:pacticipant-version": {
1701
- "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-{pacticipant}-{version}"
1702
- },
1703
- "pb:environments": {
1704
- "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-ENVIRONMENTS"
1705
- }
1706
- }
1707
- },
1708
- "matchingRules": {
1709
- "$.body._links.pb:pacticipant-version.href": {
1710
- "match": "regex",
1711
- "regex": "http:\\/\\/.*{pacticipant}.*{version}"
1712
- },
1713
- "$.body._links.pb:environments.href": {
1714
- "match": "regex",
1715
- "regex": "http:\\/\\/.*"
1716
- }
1717
- }
1718
- }
1719
- },
1720
- {
1721
- "description": "a request for a pacticipant version",
1722
- "providerState": "version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for deployment",
1723
- "request": {
1724
- "method": "GET",
1725
- "path": "/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-Foo-5556b8149bf8bac76bc30f50a8a2dd4c22c85f30",
1726
- "headers": {
1727
- "Accept": "application/hal+json"
1728
- }
1729
- },
1730
- "response": {
1731
- "status": 200,
1732
- "headers": {
1733
- "Content-Type": "application/hal+json;charset=utf-8"
1734
- },
1735
- "body": {
1736
- "_links": {
1737
- "pb:record-deployment": [
1738
- {
1739
- "name": "test",
1740
- "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-RECORD-DEPLOYMENT-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST"
1741
- }
1742
- ]
1743
- }
1744
- },
1745
- "matchingRules": {
1746
- "$.body._links.pb:record-deployment[0].href": {
1747
- "match": "regex",
1748
- "regex": "http:\\/\\/.*"
1749
- }
1750
- }
1751
- }
1752
- },
1753
- {
1754
- "description": "a request to record a deployment",
1755
- "providerState": "version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for deployment",
1756
- "request": {
1757
- "method": "POST",
1758
- "path": "/HAL-REL-PLACEHOLDER-PB-RECORD-DEPLOYMENT-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST",
1759
- "headers": {
1760
- "Content-Type": "application/json",
1761
- "Accept": "application/hal+json"
1762
- },
1763
- "body": {
1764
- "applicationInstance": "blue",
1765
- "target": "blue"
1766
- }
1767
- },
1768
- "response": {
1769
- "status": 201,
1770
- "headers": {
1771
- "Content-Type": "application/hal+json;charset=utf-8"
1772
- },
1773
- "body": {
1774
- "target": "blue"
1775
- }
1776
- }
1777
- },
1778
- {
1779
- "description": "a request for a pacticipant version",
1780
- "providerState": "version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with 2 environments that aren't test available for deployment",
1781
- "request": {
1782
- "method": "GET",
1783
- "path": "/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-Foo-5556b8149bf8bac76bc30f50a8a2dd4c22c85f30",
1784
- "headers": {
1785
- "Accept": "application/hal+json"
1786
- }
1787
- },
1788
- "response": {
1789
- "status": 200,
1790
- "headers": {
1791
- "Content-Type": "application/hal+json;charset=utf-8"
1792
- },
1793
- "body": {
1794
- "_links": {
1795
- "pb:record-deployment": [
1796
- {
1797
- "name": "prod",
1798
- "href": "href"
1799
- },
1800
- {
1801
- "name": "dev",
1802
- "href": "href"
1803
- }
1804
- ]
1805
- }
1806
- },
1807
- "matchingRules": {
1808
- "$.body._links.pb:record-deployment[0]": {
1809
- "match": "type"
1810
- },
1811
- "$.body._links.pb:record-deployment[1]": {
1812
- "match": "type"
1813
- }
1814
- }
1815
- }
1816
- },
1817
- {
1818
- "description": "a request for the environments",
1819
- "providerState": "an environment with name test exists",
1820
- "request": {
1821
- "method": "GET",
1822
- "path": "/HAL-REL-PLACEHOLDER-PB-ENVIRONMENTS",
1823
- "headers": {
1824
- "Accept": "application/hal+json"
1825
- }
1826
- },
1827
- "response": {
1828
- "status": 200,
1829
- "headers": {
1830
- "Content-Type": "application/hal+json;charset=utf-8"
1831
- },
1832
- "body": {
1833
- "_links": {
1834
- "pb:environments": [
1835
- {
1836
- "name": "test",
1837
- "href": "href"
1838
- }
1839
- ]
1840
- }
1841
- },
1842
- "matchingRules": {
1843
- "$.body._links.pb:environments[0].href": {
1844
- "match": "type"
1845
- }
1846
- }
1847
- }
1848
- },
1849
- {
1850
- "description": "a request for a pacticipant version",
1851
- "providerState": "version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for release",
1852
- "request": {
1853
- "method": "GET",
1854
- "path": "/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-Foo-5556b8149bf8bac76bc30f50a8a2dd4c22c85f30",
1855
- "headers": {
1856
- "Accept": "application/hal+json"
1857
- }
1858
- },
1859
- "response": {
1860
- "status": 200,
1861
- "headers": {
1862
- "Content-Type": "application/hal+json;charset=utf-8"
1863
- },
1864
- "body": {
1865
- "_links": {
1866
- "pb:record-release": [
1867
- {
1868
- "name": "test",
1869
- "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-RECORD-RELEASE-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST"
1870
- }
1871
- ]
1872
- }
1873
- },
1874
- "matchingRules": {
1875
- "$.body._links.pb:record-release[0].href": {
1876
- "match": "regex",
1877
- "regex": "http:\\/\\/.*"
1878
- }
1879
- }
1880
- }
1881
- },
1882
- {
1883
- "description": "a request to record a release",
1884
- "providerState": "version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for deployment",
1885
- "request": {
1886
- "method": "POST",
1887
- "path": "/HAL-REL-PLACEHOLDER-PB-RECORD-RELEASE-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST",
1888
- "headers": {
1889
- "Content-Type": "application/json",
1890
- "Accept": "application/hal+json"
1891
- }
1892
- },
1893
- "response": {
1894
- "status": 201,
1895
- "headers": {
1896
- "Content-Type": "application/hal+json;charset=utf-8"
1897
- }
1898
- }
1899
- },
1900
- {
1901
- "description": "a request for an environment",
1902
- "providerState": "an environment with name test and UUID 16926ef3-590f-4e3f-838e-719717aa88c9 exists",
1903
- "request": {
1904
- "method": "GET",
1905
- "path": "/HAL-REL-PLACEHOLDER-PB-ENVIRONMENT-16926ef3-590f-4e3f-838e-719717aa88c9",
1906
- "headers": {
1907
- "Accept": "application/hal+json"
1908
- }
1909
- },
1910
- "response": {
1911
- "status": 200,
1912
- "headers": {
1913
- "Content-Type": "application/hal+json;charset=utf-8"
1914
- },
1915
- "body": {
1916
- "_links": {
1917
- "pb:currently-deployed-deployed-versions": {
1918
- "href": "http://localhost:1234/PLACEHOLDER-ENVIRONMENT-CURRENTLY-DEPLOYED-16926ef3-590f-4e3f-838e-719717aa88c9"
1919
- }
1920
- }
1921
- },
1922
- "matchingRules": {
1923
- "$.body._links.pb:currently-deployed-deployed-versions.href": {
1924
- "match": "regex",
1925
- "regex": "^http.*"
1926
- }
1927
- }
1928
- }
1929
- },
1930
- {
1931
- "description": "a request to list the versions deployed to an environment for a pacticipant name and application instance",
1932
- "providerState": "an version is deployed to environment with UUID 16926ef3-590f-4e3f-838e-719717aa88c9 with target customer-1",
1933
- "request": {
1934
- "method": "GET",
1935
- "path": "/PLACEHOLDER-ENVIRONMENT-CURRENTLY-DEPLOYED-16926ef3-590f-4e3f-838e-719717aa88c9",
1936
- "query": "pacticipant=Foo",
1937
- "headers": {
1938
- "Accept": "application/hal+json"
1939
- }
1940
- },
1941
- "response": {
1942
- "status": 200,
1943
- "headers": {
1944
- "Content-Type": "application/hal+json;charset=utf-8"
1945
- },
1946
- "body": {
1947
- "_embedded": {
1948
- "deployedVersions": [
1949
- {
1950
- "applicationInstance": "customer-1",
1951
- "_links": {
1952
- "self": {
1953
- "href": "http://localhost:1234/PLACEHOLDER-DEPLOYED-VERSION-ff3adecf-cfc5-4653-a4e3-f1861092f8e0"
1954
- }
1955
- }
1956
- }
1957
- ]
1958
- }
1959
- },
1960
- "matchingRules": {
1961
- "$.body._embedded.deployedVersions[0]._links.self.href": {
1962
- "match": "regex",
1963
- "regex": "^http"
1964
- }
1965
- }
1966
- }
1967
- },
1968
- {
1969
- "description": "a request to mark a deployed version as not currently deploye",
1970
- "providerState": "a currently deployed version exists",
1971
- "request": {
1972
- "method": "PATCH",
1973
- "path": "/PLACEHOLDER-DEPLOYED-VERSION-ff3adecf-cfc5-4653-a4e3-f1861092f8e0",
1974
- "headers": {
1975
- "Content-Type": "application/merge-patch+json"
1976
- },
1977
- "body": {
1978
- "currentlyDeployed": false
1979
- }
1980
- },
1981
- "response": {
1982
- "status": 200,
1983
- "headers": {
1984
- "Content-Type": "application/hal+json;charset=utf-8"
1985
- },
1986
- "body": {
1987
- "currentlyDeployed": false,
1988
- "_embedded": {
1989
- "version": {
1990
- "number": "2"
1991
- }
1992
- }
1993
- },
1994
- "matchingRules": {
1995
- "$.body._embedded.version.number": {
1996
- "match": "type"
1997
- }
1998
- }
1999
- }
2000
- },
2001
- {
2002
- "description": "a request to create a webhook with a JSON body for a consumer and provider",
2003
- "providerState": "the 'Pricing Service' and 'Condor' already exist in the pact-broker",
2004
- "request": {
2005
- "method": "post",
2006
- "path": "/webhooks/provider/Pricing%20Service/consumer/Condor",
2007
- "headers": {
2008
- "Content-Type": "application/json",
2009
- "Accept": "application/hal+json"
2010
- },
2011
- "body": {
2012
- "description": "a webhook",
2013
- "events": [
2014
- {
2015
- "name": "contract_content_changed"
2016
- }
2017
- ],
2018
- "request": {
2019
- "url": "https://webhook",
2020
- "method": "POST",
2021
- "headers": {
2022
- "Foo": "bar",
2023
- "Bar": "foo"
2024
- },
2025
- "body": {
2026
- "some": "body"
2027
- },
2028
- "username": "username",
2029
- "password": "password"
2030
- }
2031
- }
2032
- },
2033
- "response": {
2034
- "status": 201,
2035
- "headers": {
2036
- "Content-Type": "application/hal+json;charset=utf-8"
2037
- },
2038
- "body": {
2039
- "description": "a webhook",
2040
- "request": {
2041
- "body": {
2042
- "some": "body"
2043
- }
2044
- },
2045
- "events": [
2046
- {
2047
- "name": "contract_content_changed"
2048
- }
2049
- ],
2050
- "_links": {
2051
- "self": {
2052
- "href": "http://localhost:1234/some-url",
2053
- "title": "A title"
2054
- }
2055
- }
2056
- },
2057
- "matchingRules": {
2058
- "$.body.description": {
2059
- "match": "type"
2060
- },
2061
- "$.body._links.self.href": {
2062
- "match": "regex",
2063
- "regex": "http:\\/\\/.*"
2064
- },
2065
- "$.body._links.self.title": {
2066
- "match": "type"
2067
- }
2068
- }
2069
- }
2070
- },
2071
- {
2072
- "description": "a request to create a webhook with every possible event type",
2073
- "providerState": "the 'Pricing Service' and 'Condor' already exist in the pact-broker",
2074
- "request": {
2075
- "method": "post",
2076
- "path": "/webhooks/provider/Pricing%20Service/consumer/Condor",
2077
- "headers": {
2078
- "Content-Type": "application/json",
2079
- "Accept": "application/hal+json"
2080
- },
2081
- "body": {
2082
- "description": "a webhook",
2083
- "events": [
2084
- {
2085
- "name": "contract_content_changed"
2086
- },
2087
- {
2088
- "name": "contract_published"
2089
- },
2090
- {
2091
- "name": "provider_verification_published"
2092
- },
2093
- {
2094
- "name": "provider_verification_succeeded"
2095
- },
2096
- {
2097
- "name": "provider_verification_failed"
2098
- }
2099
- ],
2100
- "request": {
2101
- "url": "https://webhook",
2102
- "method": "POST",
2103
- "headers": {
2104
- "Foo": "bar",
2105
- "Bar": "foo"
2106
- },
2107
- "body": {
2108
- "some": "body"
2109
- },
2110
- "username": "username",
2111
- "password": "password"
2112
- }
2113
- }
2114
- },
2115
- "response": {
2116
- "status": 201,
2117
- "headers": {
2118
- "Content-Type": "application/hal+json;charset=utf-8"
2119
- },
2120
- "body": {
2121
- "description": "a webhook",
2122
- "request": {
2123
- "body": {
2124
- "some": "body"
2125
- }
2126
- },
2127
- "events": [
2128
- {
2129
- "name": "contract_content_changed"
2130
- },
2131
- {
2132
- "name": "contract_published"
2133
- },
2134
- {
2135
- "name": "provider_verification_published"
2136
- },
2137
- {
2138
- "name": "provider_verification_succeeded"
2139
- },
2140
- {
2141
- "name": "provider_verification_failed"
2142
- }
2143
- ],
2144
- "_links": {
2145
- "self": {
2146
- "href": "http://localhost:1234/some-url",
2147
- "title": "A title"
2148
- }
2149
- }
2150
- },
2151
- "matchingRules": {
2152
- "$.body.description": {
2153
- "match": "type"
2154
- },
2155
- "$.body._links.self.href": {
2156
- "match": "regex",
2157
- "regex": "http:\\/\\/.*"
2158
- },
2159
- "$.body._links.self.title": {
2160
- "match": "type"
2161
- }
2162
- }
2163
- }
2164
- },
2165
- {
2166
- "description": "a request to create a webhook with a non-JSON body for a consumer and provider",
2167
- "providerState": "the 'Pricing Service' and 'Condor' already exist in the pact-broker",
2168
- "request": {
2169
- "method": "post",
2170
- "path": "/webhooks/provider/Pricing%20Service/consumer/Condor",
2171
- "headers": {
2172
- "Content-Type": "application/json",
2173
- "Accept": "application/hal+json"
2174
- },
2175
- "body": {
2176
- "description": "a webhook",
2177
- "events": [
2178
- {
2179
- "name": "contract_content_changed"
2180
- }
2181
- ],
2182
- "request": {
2183
- "url": "https://webhook",
2184
- "method": "POST",
2185
- "headers": {
2186
- "Foo": "bar",
2187
- "Bar": "foo"
2188
- },
2189
- "body": "<xml></xml>",
2190
- "username": "username",
2191
- "password": "password"
2192
- }
2193
- }
2194
- },
2195
- "response": {
2196
- "status": 201,
2197
- "headers": {
2198
- "Content-Type": "application/hal+json;charset=utf-8"
2199
- },
2200
- "body": {
2201
- "description": "a webhook",
2202
- "request": {
2203
- "body": "<xml></xml>"
2204
- },
2205
- "events": [
2206
- {
2207
- "name": "contract_content_changed"
2208
- }
2209
- ],
2210
- "_links": {
2211
- "self": {
2212
- "href": "http://localhost:1234/some-url",
2213
- "title": "A title"
2214
- }
2215
- }
2216
- },
2217
- "matchingRules": {
2218
- "$.body.description": {
2219
- "match": "type"
2220
- },
2221
- "$.body._links.self.href": {
2222
- "match": "regex",
2223
- "regex": "http:\\/\\/.*"
2224
- },
2225
- "$.body._links.self.title": {
2226
- "match": "type"
2227
- }
2228
- }
2229
- }
2230
- },
2231
- {
2232
- "description": "an invalid request to create a webhook for a consumer and provider",
2233
- "providerState": "the 'Pricing Service' and 'Condor' already exist in the pact-broker",
2234
- "request": {
2235
- "method": "post",
2236
- "path": "/webhooks/provider/Pricing%20Service/consumer/Condor",
2237
- "headers": {
2238
- "Content-Type": "application/json",
2239
- "Accept": "application/hal+json"
2240
- },
2241
- "body": {
2242
- "description": "a webhook",
2243
- "events": [
2244
- {
2245
- "name": "contract_content_changed"
2246
- }
2247
- ],
2248
- "request": {
2249
- "method": "POST",
2250
- "headers": {
2251
- "Foo": "bar",
2252
- "Bar": "foo"
2253
- },
2254
- "body": {
2255
- "some": "body"
2256
- },
2257
- "username": "username",
2258
- "password": "password"
2259
- }
2260
- }
2261
- },
2262
- "response": {
2263
- "status": 400,
2264
- "headers": {
2265
- "Content-Type": "application/hal+json;charset=utf-8"
2266
- },
2267
- "body": {
2268
- "errors": {
2269
- "request.url": [
2270
- "Some error"
2271
- ]
2272
- }
2273
- },
2274
- "matchingRules": {
2275
- "$.body.errors['request.url']": {
2276
- "min": 1
2277
- },
2278
- "$.body.errors['request.url'][*].*": {
2279
- "match": "type"
2280
- }
2281
- }
2282
- }
2283
- },
2284
- {
2285
- "description": "a request to create a webhook for a consumer and provider",
2286
- "providerState": "'Condor' does not exist in the pact-broker",
2287
- "request": {
2288
- "method": "post",
2289
- "path": "/webhooks/provider/Pricing%20Service/consumer/Condor",
2290
- "headers": {
2291
- "Content-Type": "application/json",
2292
- "Accept": "application/hal+json"
2293
- },
2294
- "body": {
2295
- "description": "a webhook",
2296
- "events": [
2297
- {
2298
- "name": "contract_content_changed"
2299
- }
2300
- ],
2301
- "request": {
2302
- "url": "https://webhook",
2303
- "method": "POST",
2304
- "headers": {
2305
- "Foo": "bar",
2306
- "Bar": "foo"
2307
- },
2308
- "body": {
2309
- "some": "body"
2310
- },
2311
- "username": "username",
2312
- "password": "password"
2313
- }
2314
- }
2315
- },
2316
- "response": {
2317
- "status": 404,
2318
- "headers": {
2319
- "Content-Type": "application/hal+json;charset=utf-8"
2320
- }
2321
- }
2322
- },
2323
- {
2324
- "description": "a request for the index resource",
2325
- "request": {
2326
- "method": "get",
2327
- "path": "/",
2328
- "headers": {
2329
- "Accept": "application/hal+json"
2330
- }
2331
- },
2332
- "response": {
2333
- "status": 200,
2334
- "headers": {
2335
- "Content-Type": "application/hal+json;charset=utf-8"
2336
- },
2337
- "body": {
2338
- "_links": {
2339
- "pb:webhooks": {
2340
- "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-WEBHOOKS"
2341
- },
2342
- "pb:pacticipants": {
2343
- "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-PACTICIPANTS"
2344
- },
2345
- "pb:pacticipant": {
2346
- "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-{pacticipant}"
2347
- }
2348
- }
2349
- },
2350
- "matchingRules": {
2351
- "$.body._links.pb:webhooks.href": {
2352
- "match": "regex",
2353
- "regex": "http:\\/\\/.*"
2354
- },
2355
- "$.body._links.pb:pacticipants.href": {
2356
- "match": "regex",
2357
- "regex": "http:\\/\\/.*"
2358
- },
2359
- "$.body._links.pb:pacticipant.href": {
2360
- "match": "regex",
2361
- "regex": "http:\\/\\/.*{pacticipant}"
2362
- }
2363
- }
2364
- }
2365
- },
2366
- {
2367
- "description": "a request to create a webhook with a JSON body for a consumer",
2368
- "providerState": "the 'Pricing Service' and 'Condor' already exist in the pact-broker",
2369
- "request": {
2370
- "method": "post",
2371
- "path": "/HAL-REL-PLACEHOLDER-PB-WEBHOOKS",
2372
- "headers": {
2373
- "Content-Type": "application/json",
2374
- "Accept": "application/hal+json"
2375
- },
2376
- "body": {
2377
- "description": "a webhook",
2378
- "events": [
2379
- {
2380
- "name": "contract_content_changed"
2381
- }
2382
- ],
2383
- "request": {
2384
- "url": "https://webhook",
2385
- "method": "POST",
2386
- "headers": {
2387
- "Foo": "bar",
2388
- "Bar": "foo"
2389
- },
2390
- "body": {
2391
- "some": "body"
2392
- },
2393
- "username": "username",
2394
- "password": "password"
2395
- },
2396
- "consumer": {
2397
- "name": "Condor"
2398
- }
2399
- }
2400
- },
2401
- "response": {
2402
- "status": 201,
2403
- "headers": {
2404
- "Content-Type": "application/hal+json;charset=utf-8"
2405
- },
2406
- "body": {
2407
- "description": "a webhook",
2408
- "request": {
2409
- "body": {
2410
- "some": "body"
2411
- }
2412
- },
2413
- "events": [
2414
- {
2415
- "name": "contract_content_changed"
2416
- }
2417
- ],
2418
- "_links": {
2419
- "self": {
2420
- "href": "http://localhost:1234/some-url",
2421
- "title": "A title"
2422
- }
2423
- }
2424
- },
2425
- "matchingRules": {
2426
- "$.body.description": {
2427
- "match": "type"
2428
- },
2429
- "$.body._links.self.href": {
2430
- "match": "regex",
2431
- "regex": "http:\\/\\/.*"
2432
- },
2433
- "$.body._links.self.title": {
2434
- "match": "type"
2435
- }
2436
- }
2437
- }
2438
- },
2439
- {
2440
- "description": "a request to create a webhook with a JSON body for a consumer specified by a label",
2441
- "request": {
2442
- "method": "post",
2443
- "path": "/HAL-REL-PLACEHOLDER-PB-WEBHOOKS",
2444
- "headers": {
2445
- "Content-Type": "application/json",
2446
- "Accept": "application/hal+json"
2447
- },
2448
- "body": {
2449
- "description": "a webhook",
2450
- "events": [
2451
- {
2452
- "name": "contract_content_changed"
2453
- }
2454
- ],
2455
- "request": {
2456
- "url": "https://webhook",
2457
- "method": "POST",
2458
- "headers": {
2459
- "Foo": "bar",
2460
- "Bar": "foo"
2461
- },
2462
- "body": {
2463
- "some": "body"
2464
- },
2465
- "username": "username",
2466
- "password": "password"
2467
- },
2468
- "consumer": {
2469
- "label": "consumer_label"
2470
- }
2471
- }
2472
- },
2473
- "response": {
2474
- "status": 201,
2475
- "headers": {
2476
- "Content-Type": "application/hal+json;charset=utf-8"
2477
- },
2478
- "body": {
2479
- "description": "a webhook",
2480
- "request": {
2481
- "body": {
2482
- "some": "body"
2483
- }
2484
- },
2485
- "events": [
2486
- {
2487
- "name": "contract_content_changed"
2488
- }
2489
- ],
2490
- "_links": {
2491
- "self": {
2492
- "href": "http://localhost:1234/some-url",
2493
- "title": "A title"
2494
- }
2495
- }
2496
- },
2497
- "matchingRules": {
2498
- "$.body.description": {
2499
- "match": "type"
2500
- },
2501
- "$.body._links.self.href": {
2502
- "match": "regex",
2503
- "regex": "http:\\/\\/.*"
2504
- },
2505
- "$.body._links.self.title": {
2506
- "match": "type"
2507
- }
2508
- }
2509
- }
2510
- },
2511
- {
2512
- "description": "a request to create a webhook with a JSON body for a consumer that does not exist",
2513
- "request": {
2514
- "method": "post",
2515
- "path": "/HAL-REL-PLACEHOLDER-PB-WEBHOOKS",
2516
- "headers": {
2517
- "Content-Type": "application/json",
2518
- "Accept": "application/hal+json"
2519
- },
2520
- "body": {
2521
- "description": "a webhook",
2522
- "events": [
2523
- {
2524
- "name": "contract_content_changed"
2525
- }
2526
- ],
2527
- "request": {
2528
- "url": "https://webhook",
2529
- "method": "POST",
2530
- "headers": {
2531
- "Foo": "bar",
2532
- "Bar": "foo"
2533
- },
2534
- "body": {
2535
- "some": "body"
2536
- },
2537
- "username": "username",
2538
- "password": "password"
2539
- },
2540
- "consumer": {
2541
- "name": "Condor"
2542
- }
2543
- }
2544
- },
2545
- "response": {
2546
- "status": 400,
2547
- "headers": {
2548
- "Content-Type": "application/hal+json;charset=utf-8"
2549
- },
2550
- "body": {
2551
- "errors": {
2552
- "consumer.name": [
2553
- "Some error"
2554
- ]
2555
- }
2556
- },
2557
- "matchingRules": {
2558
- "$.body.errors['consumer.name']": {
2559
- "min": 1
2560
- },
2561
- "$.body.errors['consumer.name'][*].*": {
2562
- "match": "type"
2563
- }
2564
- }
2565
- }
2566
- },
2567
- {
2568
- "description": "a request to create a webhook with a JSON body for a provider",
2569
- "providerState": "the 'Pricing Service' and 'Condor' already exist in the pact-broker",
2570
- "request": {
2571
- "method": "post",
2572
- "path": "/HAL-REL-PLACEHOLDER-PB-WEBHOOKS",
2573
- "headers": {
2574
- "Content-Type": "application/json",
2575
- "Accept": "application/hal+json"
2576
- },
2577
- "body": {
2578
- "description": "a webhook",
2579
- "events": [
2580
- {
2581
- "name": "contract_content_changed"
2582
- }
2583
- ],
2584
- "request": {
2585
- "url": "https://webhook",
2586
- "method": "POST",
2587
- "headers": {
2588
- "Foo": "bar",
2589
- "Bar": "foo"
2590
- },
2591
- "body": {
2592
- "some": "body"
2593
- },
2594
- "username": "username",
2595
- "password": "password"
2596
- },
2597
- "provider": {
2598
- "name": "Pricing Service"
2599
- }
2600
- }
2601
- },
2602
- "response": {
2603
- "status": 201,
2604
- "headers": {
2605
- "Content-Type": "application/hal+json;charset=utf-8"
2606
- },
2607
- "body": {
2608
- "description": "a webhook",
2609
- "request": {
2610
- "body": {
2611
- "some": "body"
2612
- }
2613
- },
2614
- "events": [
2615
- {
2616
- "name": "contract_content_changed"
2617
- }
2618
- ],
2619
- "_links": {
2620
- "self": {
2621
- "href": "http://localhost:1234/some-url",
2622
- "title": "A title"
2623
- }
2624
- }
2625
- },
2626
- "matchingRules": {
2627
- "$.body.description": {
2628
- "match": "type"
2629
- },
2630
- "$.body._links.self.href": {
2631
- "match": "regex",
2632
- "regex": "http:\\/\\/.*"
2633
- },
2634
- "$.body._links.self.title": {
2635
- "match": "type"
2636
- }
2637
- }
2638
- }
2639
- },
2640
- {
2641
- "description": "a request to create a webhook with a JSON body for a provider specified by a label",
2642
- "request": {
2643
- "method": "post",
2644
- "path": "/HAL-REL-PLACEHOLDER-PB-WEBHOOKS",
2645
- "headers": {
2646
- "Content-Type": "application/json",
2647
- "Accept": "application/hal+json"
2648
- },
2649
- "body": {
2650
- "description": "a webhook",
2651
- "events": [
2652
- {
2653
- "name": "contract_content_changed"
2654
- }
2655
- ],
2656
- "request": {
2657
- "url": "https://webhook",
2658
- "method": "POST",
2659
- "headers": {
2660
- "Foo": "bar",
2661
- "Bar": "foo"
2662
- },
2663
- "body": {
2664
- "some": "body"
2665
- },
2666
- "username": "username",
2667
- "password": "password"
2668
- },
2669
- "provider": {
2670
- "label": "provider_label"
2671
- }
2672
- }
2673
- },
2674
- "response": {
2675
- "status": 201,
2676
- "headers": {
2677
- "Content-Type": "application/hal+json;charset=utf-8"
2678
- },
2679
- "body": {
2680
- "description": "a webhook",
2681
- "request": {
2682
- "body": {
2683
- "some": "body"
2684
- }
2685
- },
2686
- "events": [
2687
- {
2688
- "name": "contract_content_changed"
2689
- }
2690
- ],
2691
- "_links": {
2692
- "self": {
2693
- "href": "http://localhost:1234/some-url",
2694
- "title": "A title"
2695
- }
2696
- }
2697
- },
2698
- "matchingRules": {
2699
- "$.body.description": {
2700
- "match": "type"
2701
- },
2702
- "$.body._links.self.href": {
2703
- "match": "regex",
2704
- "regex": "http:\\/\\/.*"
2705
- },
2706
- "$.body._links.self.title": {
2707
- "match": "type"
2708
- }
2709
- }
2710
- }
2711
- },
2712
- {
2713
- "description": "a request to create a global webhook with a JSON body",
2714
- "request": {
2715
- "method": "post",
2716
- "path": "/HAL-REL-PLACEHOLDER-PB-WEBHOOKS",
2717
- "headers": {
2718
- "Content-Type": "application/json",
2719
- "Accept": "application/hal+json"
2720
- },
2721
- "body": {
2722
- "description": "a webhook",
2723
- "events": [
2724
- {
2725
- "name": "contract_content_changed"
2726
- }
2727
- ],
2728
- "request": {
2729
- "url": "https://webhook",
2730
- "method": "POST",
2731
- "headers": {
2732
- "Foo": "bar",
2733
- "Bar": "foo"
2734
- },
2735
- "body": {
2736
- "some": "body"
2737
- },
2738
- "username": "username",
2739
- "password": "password"
2740
- }
2741
- }
2742
- },
2743
- "response": {
2744
- "status": 201,
2745
- "headers": {
2746
- "Content-Type": "application/hal+json;charset=utf-8"
2747
- },
2748
- "body": {
2749
- "description": "a webhook",
2750
- "request": {
2751
- "body": {
2752
- "some": "body"
2753
- }
2754
- },
2755
- "events": [
2756
- {
2757
- "name": "contract_content_changed"
2758
- }
2759
- ],
2760
- "_links": {
2761
- "self": {
2762
- "href": "http://localhost:1234/some-url",
2763
- "title": "A title"
2764
- }
2765
- }
2766
- },
2767
- "matchingRules": {
2768
- "$.body.description": {
2769
- "match": "type"
2770
- },
2771
- "$.body._links.self.href": {
2772
- "match": "regex",
2773
- "regex": "http:\\/\\/.*"
2774
- },
2775
- "$.body._links.self.title": {
2776
- "match": "type"
2777
- }
2778
- }
2779
- }
2780
- },
2781
- {
2782
- "description": "a request for the index resource with the webhook relation",
2783
- "request": {
2784
- "method": "get",
2785
- "path": "/",
2786
- "headers": {
2787
- "Accept": "application/hal+json"
2788
- }
2789
- },
2790
- "response": {
2791
- "status": 200,
2792
- "headers": {
2793
- "Content-Type": "application/hal+json;charset=utf-8"
2794
- },
2795
- "body": {
2796
- "_links": {
2797
- "pb:webhook": {
2798
- "href": "http://localhost:1234/webhooks/{uuid}",
2799
- "templated": true
2800
- }
2801
- }
2802
- },
2803
- "matchingRules": {
2804
- "$.body._links.pb:webhook.href": {
2805
- "match": "regex",
2806
- "regex": "http:\\/\\/.*\\/webhooks\\/{uuid}"
2807
- }
2808
- }
2809
- }
2810
- },
2811
- {
2812
- "description": "a request to create a webhook with a JSON body and a uuid",
2813
- "providerState": "the 'Pricing Service' and 'Condor' already exist in the pact-broker",
2814
- "request": {
2815
- "method": "put",
2816
- "path": "/webhooks/696c5f93-1b7f-44bc-8d03-59440fcaa9a0",
2817
- "headers": {
2818
- "Content-Type": "application/json",
2819
- "Accept": "application/hal+json"
2820
- },
2821
- "body": {
2822
- "description": "a webhook",
2823
- "events": [
2824
- {
2825
- "name": "contract_content_changed"
2826
- }
2827
- ],
2828
- "request": {
2829
- "url": "https://webhook",
2830
- "method": "POST",
2831
- "headers": {
2832
- "Foo": "bar",
2833
- "Bar": "foo"
2834
- },
2835
- "body": {
2836
- "some": "body"
2837
- },
2838
- "username": "username",
2839
- "password": "password"
2840
- },
2841
- "provider": {
2842
- "name": "Pricing Service"
2843
- },
2844
- "consumer": {
2845
- "name": "Condor"
2846
- }
2847
- }
2848
- },
2849
- "response": {
2850
- "status": 201,
2851
- "headers": {
2852
- "Content-Type": "application/hal+json;charset=utf-8"
2853
- },
2854
- "body": {
2855
- "description": "a webhook",
2856
- "request": {
2857
- "body": {
2858
- "some": "body"
2859
- }
2860
- },
2861
- "events": [
2862
- {
2863
- "name": "contract_content_changed"
2864
- }
2865
- ],
2866
- "_links": {
2867
- "self": {
2868
- "href": "http://localhost:1234/some-url",
2869
- "title": "A title"
2870
- }
2871
- }
2872
- },
2873
- "matchingRules": {
2874
- "$.body.description": {
2875
- "match": "type"
2876
- },
2877
- "$.body._links.self.href": {
2878
- "match": "regex",
2879
- "regex": "http:\\/\\/.*"
2880
- },
2881
- "$.body._links.self.title": {
2882
- "match": "type"
2883
- }
2884
- }
2885
- }
2886
- },
2887
- {
2888
- "description": "a request to update a webhook",
2889
- "providerState": "a webhook with the uuid 696c5f93-1b7f-44bc-8d03-59440fcaa9a0 exists",
2890
- "request": {
2891
- "method": "put",
2892
- "path": "/webhooks/696c5f93-1b7f-44bc-8d03-59440fcaa9a0",
2893
- "headers": {
2894
- "Content-Type": "application/json",
2895
- "Accept": "application/hal+json"
2896
- },
2897
- "body": {
2898
- "description": "a webhook",
2899
- "events": [
2900
- {
2901
- "name": "contract_content_changed"
2902
- }
2903
- ],
2904
- "request": {
2905
- "url": "https://webhook",
2906
- "method": "POST",
2907
- "headers": {
2908
- "Foo": "bar",
2909
- "Bar": "foo"
2910
- },
2911
- "body": {
2912
- "some": "body"
2913
- },
2914
- "username": "username",
2915
- "password": "password"
2916
- },
2917
- "provider": {
2918
- "name": "Pricing Service"
2919
- },
2920
- "consumer": {
2921
- "name": "Condor"
2922
- }
2923
- }
2924
- },
2925
- "response": {
2926
- "status": 200,
2927
- "headers": {
2928
- "Content-Type": "application/hal+json;charset=utf-8"
2929
- },
2930
- "body": {
2931
- "description": "a webhook",
2932
- "request": {
2933
- "body": {
2934
- "some": "body"
2935
- }
2936
- },
2937
- "events": [
2938
- {
2939
- "name": "contract_content_changed"
2940
- }
2941
- ],
2942
- "_links": {
2943
- "self": {
2944
- "href": "http://localhost:1234/some-url",
2945
- "title": "A title"
2946
- }
2947
- }
2948
- },
2949
- "matchingRules": {
2950
- "$.body.description": {
2951
- "match": "type"
2952
- },
2953
- "$.body._links.self.href": {
2954
- "match": "regex",
2955
- "regex": "http:\\/\\/.*"
2956
- },
2957
- "$.body._links.self.title": {
2958
- "match": "type"
2959
- }
2960
- }
2961
- }
2962
- }
2963
- ],
2964
- "metadata": {
2965
- "pactSpecification": {
2966
- "version": "2.0.0"
2967
- }
2968
- }
2969
- }