pact_broker-client 1.25.0 → 1.27.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/trigger_pact_cli_release.yml +15 -0
  3. data/.github/workflows/trigger_pact_docs_update.yml +21 -0
  4. data/CHANGELOG.md +55 -0
  5. data/Gemfile +6 -1
  6. data/README.md +4 -3
  7. data/doc/pacts/markdown/Pact Broker Client - Pact Broker.md +234 -10
  8. data/lib/pact_broker/client/can_i_deploy.rb +6 -0
  9. data/lib/pact_broker/client/cli/broker.rb +33 -0
  10. data/lib/pact_broker/client/cli/custom_thor.rb +36 -14
  11. data/lib/pact_broker/client/git.rb +2 -1
  12. data/lib/pact_broker/client/hal/entity.rb +13 -4
  13. data/lib/pact_broker/client/hal/http_client.rb +6 -0
  14. data/lib/pact_broker/client/hal/link.rb +5 -1
  15. data/lib/pact_broker/client/hal_client_methods.rb +15 -0
  16. data/lib/pact_broker/client/matrix/resource.rb +5 -1
  17. data/lib/pact_broker/client/pacticipants/create.rb +57 -0
  18. data/lib/pact_broker/client/pacts/list_latest_versions.rb +65 -0
  19. data/lib/pact_broker/client/publish_pacts.rb +1 -1
  20. data/lib/pact_broker/client/version.rb +1 -1
  21. data/lib/pact_broker/client/webhooks/create.rb +7 -1
  22. data/lib/pact_broker/client/webhooks/test.rb +16 -0
  23. data/pact-broker-client.gemspec +3 -4
  24. data/spec/integration/can_i_deploy_spec.rb +3 -3
  25. data/spec/integration/create_version_tag_spec.rb +2 -3
  26. data/spec/lib/pact_broker/client/can_i_deploy_spec.rb +22 -4
  27. data/spec/lib/pact_broker/client/cli/broker_run_webhook_commands_spec.rb +2 -0
  28. data/spec/lib/pact_broker/client/cli/custom_thor_spec.rb +6 -0
  29. data/spec/lib/pact_broker/client/hal/entity_spec.rb +1 -0
  30. data/spec/lib/pact_broker/client/pacticipants/create_spec.rb +28 -0
  31. data/spec/lib/pact_broker/client/webhooks/create_spec.rb +22 -0
  32. data/spec/pacts/pact_broker_client-pact_broker.json +273 -10
  33. data/spec/service_providers/pact_broker_client_matrix_spec.rb +10 -10
  34. data/spec/service_providers/pact_helper.rb +29 -0
  35. data/spec/service_providers/pacticipants_create_spec.rb +118 -0
  36. data/spec/service_providers/webhooks_create_spec.rb +46 -17
  37. metadata +25 -30
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c23dc5746d9c229a4e357c8fe96273902ba48eb009a23feba13ec82e176bbb30
4
- data.tar.gz: 482f212c6ed800809fe09ac51cc42b4bddf726fc0a1d37d9ad271cdbb12378d4
3
+ metadata.gz: 6a3ac52aded8ce1f6e2c2118184d9aa1a63572a9623b22e396eec44f27b8499c
4
+ data.tar.gz: e91adf448e4e68a8e5abb1f1707009d2b8eb77e19c0a8a2ead0a3c78edceb4f7
5
5
  SHA512:
6
- metadata.gz: b5dc6e9ffc7ee3d88711cc0a606d2616e00c826e6681bc84a652e37f18a944f8e402b7265a828a4ddbd16a7d5591fd9e40f8938761112411f58a08c2cc1cc3c6
7
- data.tar.gz: c28296e8fc790b329061809abaa58af206765061fdb5d07bf2c1d60861408184b304f20c725faf2b3a4ebb59ca3e8cf23f8d8d992f9069da63b55ba60826b13d
6
+ metadata.gz: d60c7c13b4519e8cb695a4f57faf543b7e735efd30aed66c7308d42c5173d3412fda37969b00361f034e88e789b0d82dc16a6c94b4f50bedaa674e1553897184
7
+ data.tar.gz: 507e44ca2ba9e9283d3b655d11992263fe4a8dc82585b723e6f4f51869ee392b78ef23e4e61a348474dde53af694bb80961e2bff413fab7d90617ecadc240be0
@@ -0,0 +1,15 @@
1
+ name: Trigger release of the pact-cli Docker image
2
+ on:
3
+ release:
4
+ types: [created]
5
+
6
+ jobs:
7
+ build:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - name: Repository Dispatch
11
+ uses: peter-evans/repository-dispatch@v1
12
+ with:
13
+ token: ${{ secrets.GHTOKENFORPACTCLIRELEASE }}
14
+ repository: pact-foundation/pact-ruby-cli
15
+ event-type: gem-released
@@ -0,0 +1,21 @@
1
+ name: Trigger update to docs.pact.io
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ paths:
8
+ - '**.md'
9
+
10
+ jobs:
11
+ run:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Trigger docs.pact.io update workflow
15
+ run: |
16
+ curl -X POST https://api.github.com/repos/pact-foundation/docs.pact.io/dispatches \
17
+ -H 'Accept: application/vnd.github.everest-preview+json' \
18
+ -H "Authorization: Bearer $GITHUB_TOKEN" \
19
+ -d '{"event_type": "pact-broker-client-docs-updated"}'
20
+ env:
21
+ GITHUB_TOKEN: ${{ secrets.GHTOKENFORTRIGGERINGPACTDOCSUPDATE }}
@@ -1,3 +1,58 @@
1
+ <a name="v1.27.1"></a>
2
+ ### v1.27.1 (2020-07-10)
3
+
4
+
5
+ #### Features
6
+
7
+ * **deps**
8
+ * this isn't really a feature, but I want to test the release workflow ([29a7b72](/../../commit/29a7b72))
9
+
10
+
11
+ <a name="v1.27.0"></a>
12
+ ### v1.27.0 (2020-05-09)
13
+
14
+
15
+ #### Features
16
+
17
+ * add BITBUCKET_BRANCH to list of known branch variables (#69) ([d1dc088](/../../commit/d1dc088))
18
+ * add list-latest-pact-versions command ([ed45d58](/../../commit/ed45d58))
19
+
20
+
21
+ <a name="v1.26.0"></a>
22
+ ### v1.26.0 (2020-04-17)
23
+
24
+
25
+ #### Features
26
+
27
+ * update message when waiting for verification results ([68df012](/../../commit/68df012))
28
+ * add create-or-update-pacticipant ([f1c33ae](/../../commit/f1c33ae))
29
+
30
+ * **can i deploy**
31
+ * put out a message while waiting for verification results to be published ([cc1ba5f](/../../commit/cc1ba5f))
32
+
33
+ * **publish pacts**
34
+ * improve message when overwriting pacts ([17b93f3](/../../commit/17b93f3))
35
+
36
+ * **webhooks**
37
+ * add command to test webhook execution ([0ee1f7a](/../../commit/0ee1f7a))
38
+
39
+
40
+ <a name="v1.25.1"></a>
41
+ ### v1.25.1 (2020-04-02)
42
+
43
+
44
+ #### Features
45
+
46
+ * **create-or-update-webhook**
47
+ * print 'created' or 'updated' based on response status ([0c34090](/../../commit/0c34090))
48
+
49
+
50
+ #### Bug Fixes
51
+
52
+ * incorrect require path for hal entity ([64f3b7b](/../../commit/64f3b7b))
53
+ * correctly handle multiple parameters specified in the format --name=value ([946001b](/../../commit/946001b))
54
+
55
+
1
56
  <a name="v1.25.0"></a>
2
57
  ### v1.25.0 (2020-02-18)
3
58
 
data/Gemfile CHANGED
@@ -4,4 +4,9 @@ gemspec
4
4
 
5
5
  # Not sure why jruby on Travis fails saying rake is not part of the bundle,
6
6
  # even thought it's in the development dependencies. Trying it here.
7
- gem 'rake', '~> 10.0.3'
7
+ gem 'rake', '~> 13.0'
8
+
9
+ if ENV['X_PACT_DEVELOPMENT'] == 'true'
10
+ gem 'pact-mock_service', path: '../pact-mock_service'
11
+ gem 'pact-support', path: '../pact-support'
12
+ end
data/README.md CHANGED
@@ -1,9 +1,11 @@
1
1
  # Pact Broker Client
2
2
 
3
- A client for the Pact Broker. Publishes pacts to, and retrieves pacts from, a Pact Broker. The functionality is available via a CLI, or via Ruby Rake tasks. You can also use the [Pact CLI Docker image](https://hub.docker.com/r/pactfoundation/pact-cli).
3
+ A client for the Pact Broker. Publishes and retrieves pacts, verification results, pacticipants, pacticipant versions and tags. The functionality is available via a CLI, or via Ruby Rake tasks. You can also use the [Pact CLI Docker image](https://hub.docker.com/r/pactfoundation/pact-cli).
4
4
 
5
5
  [![Build Status](https://travis-ci.org/pact-foundation/pact_broker-client.svg?branch=master)](https://travis-ci.org/pact-foundation/pact_broker-client)
6
6
 
7
+ ![Trigger update to docs.pact.io](https://github.com/pact-foundation/pact_broker-client/workflows/Trigger%20update%20to%20docs.pact.io/badge.svg)
8
+
7
9
  ## Installation
8
10
 
9
11
  ### CLI
@@ -345,6 +347,5 @@ end
345
347
  bundle exec rake pact:publish
346
348
  ```
347
349
 
348
- [wiki-tags]: https://github.com/pact-foundation/pact_broker/wiki/Using-tags
349
350
  [pact-ruby-standalone]: https://github.com/pact-foundation/pact-ruby-standalone/releases
350
- [docker]: https://cloud.docker.com/u/pactfoundation/repository/docker/pactfoundation/pact-cli
351
+ [docker]: https://hub.docker.com/r/pactfoundation/pact-cli
@@ -22,6 +22,8 @@
22
22
 
23
23
  * [A request for the index resource](#a_request_for_the_index_resource)
24
24
 
25
+ * [A request for the index resource](#a_request_for_the_index_resource_given_the_pacticipant_relations_are_present) given the pacticipant relations are present
26
+
25
27
  * [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
26
28
 
27
29
  * [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
@@ -38,6 +40,8 @@
38
40
 
39
41
  * [A request to create a global webhook with a JSON body](#a_request_to_create_a_global_webhook_with_a_JSON_body)
40
42
 
43
+ * [A request to create a pacticipant](#a_request_to_create_a_pacticipant)
44
+
41
45
  * [A request to create a webhook for a consumer and provider](#a_request_to_create_a_webhook_for_a_consumer_and_provider_given_&#39;Condor&#39;_does_not_exist_in_the_pact-broker) given 'Condor' does not exist in the pact-broker
42
46
 
43
47
  * [A request to create a webhook with a JSON body and a uuid](#a_request_to_create_a_webhook_with_a_JSON_body_and_a_uuid_given_the_&#39;Pricing_Service&#39;_and_&#39;Condor&#39;_already_exist_in_the_pact-broker) given the 'Pricing Service' and 'Condor' already exist in the pact-broker
@@ -76,6 +80,10 @@
76
80
 
77
81
  * [A request to register the repository URL of a pacticipant](#a_request_to_register_the_repository_URL_of_a_pacticipant_given_the_&#39;Pricing_Service&#39;_does_not_exist_in_the_pact-broker) given the 'Pricing Service' does not exist in the pact-broker
78
82
 
83
+ * [A request to retrieve a pacticipant](#a_request_to_retrieve_a_pacticipant_given_a_pacticipant_with_name_Foo_exists) given a pacticipant with name Foo exists
84
+
85
+ * [A request to retrieve a pacticipant](#a_request_to_retrieve_a_pacticipant)
86
+
79
87
  * [A request to retrieve the latest 'production' version of Condor](#a_request_to_retrieve_the_latest_&#39;production&#39;_version_of_Condor_given_&#39;Condor&#39;_exists_in_the_pact-broker_with_the_latest_tagged_&#39;production&#39;_version_1.2.3) given 'Condor' exists in the pact-broker with the latest tagged 'production' version 1.2.3
80
88
 
81
89
  * [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
@@ -92,6 +100,10 @@
92
100
 
93
101
  * [A request to tag the production version of Condor](#a_request_to_tag_the_production_version_of_Condor_given_&#39;Condor&#39;_exists_in_the_pact-broker) given 'Condor' exists in the pact-broker
94
102
 
103
+ * [A request to update a pacticipant](#a_request_to_update_a_pacticipant_given_a_pacticipant_with_name_Foo_exists) given a pacticipant with name Foo exists
104
+
105
+ * [A request to update a webhook](#a_request_to_update_a_webhook_given_a_webhook_with_the_uuid_696c5f93-1b7f-44bc-8d03-59440fcaa9a0_exists) given a webhook with the uuid 696c5f93-1b7f-44bc-8d03-59440fcaa9a0 exists
106
+
95
107
  * [An invalid request to create a webhook for a consumer and provider](#an_invalid_request_to_create_a_webhook_for_a_consumer_and_provider_given_the_&#39;Pricing_Service&#39;_and_&#39;Condor&#39;_already_exist_in_the_pact-broker) given the 'Pricing Service' and 'Condor' already exist in the pact-broker
96
108
 
97
109
  #### Interactions
@@ -102,7 +114,7 @@ Upon receiving **a request for the compatibility matrix for a pacticipant that d
102
114
  {
103
115
  "method": "get",
104
116
  "path": "/matrix",
105
- "query": "q[][pacticipant]=Wiffle&q[][version]=1.2.3&q[][pacticipant]=Meep&q[][version]=9.9.9&latestby=cvpv"
117
+ "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"
106
118
  }
107
119
  ```
108
120
  Pact Broker will respond with:
@@ -125,7 +137,7 @@ Given **the pact for Foo version 1.2.3 and 1.2.4 has been verified by Bar versio
125
137
  {
126
138
  "method": "get",
127
139
  "path": "/matrix",
128
- "query": "q[][pacticipant]=Foo&q[][pacticipant]=Bar&latestby=cvpv"
140
+ "query": "q%5B%5D%5Bpacticipant%5D=Foo&q%5B%5D%5Bpacticipant%5D=Bar&latestby=cvpv"
129
141
  }
130
142
  ```
131
143
  Pact Broker will respond with:
@@ -189,7 +201,7 @@ Given **the pact for Foo Thing version 1.2.3 has been verified by Bar version 4.
189
201
  {
190
202
  "method": "get",
191
203
  "path": "/matrix",
192
- "query": "q[][pacticipant]=Foo%20Thing&q[][version]=1.2.3&q[][pacticipant]=Bar&q[][version]=4.5.6&latestby=cvpv"
204
+ "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"
193
205
  }
194
206
  ```
195
207
  Pact Broker will respond with:
@@ -237,7 +249,7 @@ Given **the pact for Foo version 1.2.3 has been verified by Bar version 4.5.6**,
237
249
  {
238
250
  "method": "get",
239
251
  "path": "/matrix",
240
- "query": "q[][pacticipant]=Foo&q[][version]=1.2.3&q[][pacticipant]=Bar&q[][version]=4.5.6&latestby=cvpv"
252
+ "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"
241
253
  }
242
254
  ```
243
255
  Pact Broker will respond with:
@@ -285,7 +297,7 @@ Given **the pact for Foo version 1.2.3 has been successfully verified by Bar ver
285
297
  {
286
298
  "method": "get",
287
299
  "path": "/matrix",
288
- "query": "q[][pacticipant]=Foo&q[][version]=1.2.3&q[][pacticipant]=Bar&q[][latest]=true&q[][tag]=prod&latestby=cvpv"
300
+ "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"
289
301
  }
290
302
  ```
291
303
  Pact Broker will respond with:
@@ -333,7 +345,7 @@ Given **the pact for Foo version 1.2.3 has been successfully verified by Bar ver
333
345
  {
334
346
  "method": "get",
335
347
  "path": "/matrix",
336
- "query": "q[][pacticipant]=Foo&q[][version]=1.2.3&latestby=cvp&latest=true&tag=prod"
348
+ "query": "q%5B%5D%5Bpacticipant%5D=Foo&q%5B%5D%5Bversion%5D=1.2.3&latestby=cvp&latest=true&tag=prod"
337
349
  }
338
350
  ```
339
351
  Pact Broker will respond with:
@@ -369,7 +381,7 @@ Given **the pact for Foo version 1.2.3 has been successfully verified by Bar ver
369
381
  {
370
382
  "method": "get",
371
383
  "path": "/matrix",
372
- "query": "q[][pacticipant]=Foo&q[][version]=1.2.4&q[][pacticipant]=Bar&q[][latest]=true&latestby=cvpv"
384
+ "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"
373
385
  }
374
386
  ```
375
387
  Pact Broker will respond with:
@@ -417,7 +429,7 @@ Given **the pact for Foo version 1.2.3 has been verified by Bar version 4.5.6**,
417
429
  {
418
430
  "method": "get",
419
431
  "path": "/matrix",
420
- "query": "q[][pacticipant]=Foo&q[][version]=1.2.3&q[][pacticipant]=Bar&q[][version]=9.9.9&latestby=cvpv"
432
+ "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"
421
433
  }
422
434
  ```
423
435
  Pact Broker will respond with:
@@ -440,7 +452,7 @@ Given **the pact for Foo version 1.2.3 has been verified by Bar version 4.5.6 an
440
452
  {
441
453
  "method": "get",
442
454
  "path": "/matrix",
443
- "query": "q[][pacticipant]=Foo&q[][version]=1.2.3&latestby=cvp&latest=true"
455
+ "query": "q%5B%5D%5Bpacticipant%5D=Foo&q%5B%5D%5Bversion%5D=1.2.3&latestby=cvp&latest=true"
444
456
  }
445
457
  ```
446
458
  Pact Broker will respond with:
@@ -504,6 +516,42 @@ Pact Broker will respond with:
504
516
  "_links": {
505
517
  "pb:webhooks": {
506
518
  "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-WEBHOOKS"
519
+ },
520
+ "pb:pacticipants": {
521
+ "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-PACTICIPANTS"
522
+ },
523
+ "pb:pacticipant": {
524
+ "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-{pacticipant}"
525
+ }
526
+ }
527
+ }
528
+ }
529
+ ```
530
+ <a name="a_request_for_the_index_resource_given_the_pacticipant_relations_are_present"></a>
531
+ Given **the pacticipant relations are present**, upon receiving **a request for the index resource** from Pact Broker Client, with
532
+ ```json
533
+ {
534
+ "method": "get",
535
+ "path": "/",
536
+ "headers": {
537
+ "Accept": "application/hal+json"
538
+ }
539
+ }
540
+ ```
541
+ Pact Broker will respond with:
542
+ ```json
543
+ {
544
+ "status": 200,
545
+ "headers": {
546
+ "Content-Type": "application/hal+json;charset=utf-8"
547
+ },
548
+ "body": {
549
+ "_links": {
550
+ "pb:pacticipants": {
551
+ "href": "http://localhost:1234/pacticipants"
552
+ },
553
+ "pb:pacticipant": {
554
+ "href": "http://localhost:1234/pacticipants/{pacticipant}"
507
555
  }
508
556
  }
509
557
  }
@@ -655,7 +703,7 @@ Given **the pact for Foo version 1.2.3 has been successfully verified by Bar ver
655
703
  {
656
704
  "method": "get",
657
705
  "path": "/matrix",
658
- "query": "q[][pacticipant]=Foo&q[][pacticipant]=Bar&latestby=cvpv&success[]=true"
706
+ "query": "q%5B%5D%5Bpacticipant%5D=Foo&q%5B%5D%5Bpacticipant%5D=Bar&latestby=cvpv&success%5B%5D=true"
659
707
  }
660
708
  ```
661
709
  Pact Broker will respond with:
@@ -766,6 +814,7 @@ Pact Broker will respond with:
766
814
  "Content-Type": "application/hal+json;charset=utf-8"
767
815
  },
768
816
  "body": {
817
+ "description": "a webhook",
769
818
  "_links": {
770
819
  "self": {
771
820
  "href": "http://localhost:1234/some-url",
@@ -775,6 +824,40 @@ Pact Broker will respond with:
775
824
  }
776
825
  }
777
826
  ```
827
+ <a name="a_request_to_create_a_pacticipant"></a>
828
+ Upon receiving **a request to create a pacticipant** from Pact Broker Client, with
829
+ ```json
830
+ {
831
+ "method": "post",
832
+ "path": "/pacticipants",
833
+ "headers": {
834
+ "Content-Type": "application/json",
835
+ "Accept": "application/hal+json"
836
+ },
837
+ "body": {
838
+ "name": "Foo",
839
+ "repositoryUrl": "http://foo"
840
+ }
841
+ }
842
+ ```
843
+ Pact Broker will respond with:
844
+ ```json
845
+ {
846
+ "status": 201,
847
+ "headers": {
848
+ "Content-Type": "application/hal+json;charset=utf-8"
849
+ },
850
+ "body": {
851
+ "name": "Foo",
852
+ "repositoryUrl": "http://foo",
853
+ "_links": {
854
+ "self": {
855
+ "href": "http://localhost:1234/pacticipants/Foo"
856
+ }
857
+ }
858
+ }
859
+ }
860
+ ```
778
861
  <a name="a_request_to_create_a_webhook_for_a_consumer_and_provider_given_&#39;Condor&#39;_does_not_exist_in_the_pact-broker"></a>
779
862
  Given **'Condor' does not exist in the pact-broker**, upon receiving **a request to create a webhook for a consumer and provider** from Pact Broker Client, with
780
863
  ```json
@@ -864,6 +947,7 @@ Pact Broker will respond with:
864
947
  "Content-Type": "application/hal+json;charset=utf-8"
865
948
  },
866
949
  "body": {
950
+ "description": "a webhook",
867
951
  "_links": {
868
952
  "self": {
869
953
  "href": "http://localhost:1234/some-url",
@@ -917,6 +1001,7 @@ Pact Broker will respond with:
917
1001
  "Content-Type": "application/hal+json;charset=utf-8"
918
1002
  },
919
1003
  "body": {
1004
+ "description": "a webhook",
920
1005
  "_links": {
921
1006
  "self": {
922
1007
  "href": "http://localhost:1234/some-url",
@@ -967,6 +1052,7 @@ Pact Broker will respond with:
967
1052
  "Content-Type": "application/hal+json;charset=utf-8"
968
1053
  },
969
1054
  "body": {
1055
+ "description": "a webhook",
970
1056
  "_links": {
971
1057
  "self": {
972
1058
  "href": "http://localhost:1234/some-url",
@@ -1072,6 +1158,7 @@ Pact Broker will respond with:
1072
1158
  "Content-Type": "application/hal+json;charset=utf-8"
1073
1159
  },
1074
1160
  "body": {
1161
+ "description": "a webhook",
1075
1162
  "_links": {
1076
1163
  "self": {
1077
1164
  "href": "http://localhost:1234/some-url",
@@ -1120,6 +1207,7 @@ Pact Broker will respond with:
1120
1207
  "Content-Type": "application/hal+json;charset=utf-8"
1121
1208
  },
1122
1209
  "body": {
1210
+ "description": "a webhook",
1123
1211
  "_links": {
1124
1212
  "self": {
1125
1213
  "href": "http://localhost:1234/some-url",
@@ -1182,6 +1270,7 @@ Pact Broker will respond with:
1182
1270
  "Content-Type": "application/hal+json;charset=utf-8"
1183
1271
  },
1184
1272
  "body": {
1273
+ "description": "a webhook",
1185
1274
  "_links": {
1186
1275
  "self": {
1187
1276
  "href": "http://localhost:1234/some-url",
@@ -1589,6 +1678,50 @@ Pact Broker will respond with:
1589
1678
  }
1590
1679
  }
1591
1680
  ```
1681
+ <a name="a_request_to_retrieve_a_pacticipant_given_a_pacticipant_with_name_Foo_exists"></a>
1682
+ Given **a pacticipant with name Foo exists**, upon receiving **a request to retrieve a pacticipant** from Pact Broker Client, with
1683
+ ```json
1684
+ {
1685
+ "method": "get",
1686
+ "path": "/pacticipants/Foo",
1687
+ "headers": {
1688
+ "Accept": "application/hal+json"
1689
+ }
1690
+ }
1691
+ ```
1692
+ Pact Broker will respond with:
1693
+ ```json
1694
+ {
1695
+ "status": 200,
1696
+ "headers": {
1697
+ "Content-Type": "application/hal+json;charset=utf-8"
1698
+ },
1699
+ "body": {
1700
+ "_links": {
1701
+ "self": {
1702
+ "href": "http://localhost:1234/pacticipants/Foo"
1703
+ }
1704
+ }
1705
+ }
1706
+ }
1707
+ ```
1708
+ <a name="a_request_to_retrieve_a_pacticipant"></a>
1709
+ Upon receiving **a request to retrieve a pacticipant** from Pact Broker Client, with
1710
+ ```json
1711
+ {
1712
+ "method": "get",
1713
+ "path": "/pacticipants/Foo",
1714
+ "headers": {
1715
+ "Accept": "application/hal+json"
1716
+ }
1717
+ }
1718
+ ```
1719
+ Pact Broker will respond with:
1720
+ ```json
1721
+ {
1722
+ "status": 404
1723
+ }
1724
+ ```
1592
1725
  <a name="a_request_to_retrieve_the_latest_&#39;production&#39;_version_of_Condor_given_&#39;Condor&#39;_exists_in_the_pact-broker_with_the_latest_tagged_&#39;production&#39;_version_1.2.3"></a>
1593
1726
  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
1594
1727
  ```json
@@ -1800,6 +1933,97 @@ Pact Broker will respond with:
1800
1933
  }
1801
1934
  }
1802
1935
  ```
1936
+ <a name="a_request_to_update_a_pacticipant_given_a_pacticipant_with_name_Foo_exists"></a>
1937
+ Given **a pacticipant with name Foo exists**, upon receiving **a request to update a pacticipant** from Pact Broker Client, with
1938
+ ```json
1939
+ {
1940
+ "method": "patch",
1941
+ "path": "/pacticipants/Foo",
1942
+ "headers": {
1943
+ "Content-Type": "application/json",
1944
+ "Accept": "application/hal+json"
1945
+ },
1946
+ "body": {
1947
+ "name": "Foo",
1948
+ "repositoryUrl": "http://foo"
1949
+ }
1950
+ }
1951
+ ```
1952
+ Pact Broker will respond with:
1953
+ ```json
1954
+ {
1955
+ "status": 200,
1956
+ "headers": {
1957
+ "Content-Type": "application/hal+json;charset=utf-8"
1958
+ },
1959
+ "body": {
1960
+ "name": "Foo",
1961
+ "repositoryUrl": "http://foo",
1962
+ "_links": {
1963
+ "self": {
1964
+ "href": "http://localhost:1234/pacticipants/Foo"
1965
+ }
1966
+ }
1967
+ }
1968
+ }
1969
+ ```
1970
+ <a name="a_request_to_update_a_webhook_given_a_webhook_with_the_uuid_696c5f93-1b7f-44bc-8d03-59440fcaa9a0_exists"></a>
1971
+ Given **a webhook with the uuid 696c5f93-1b7f-44bc-8d03-59440fcaa9a0 exists**, upon receiving **a request to update a webhook** from Pact Broker Client, with
1972
+ ```json
1973
+ {
1974
+ "method": "put",
1975
+ "path": "/webhooks/696c5f93-1b7f-44bc-8d03-59440fcaa9a0",
1976
+ "headers": {
1977
+ "Content-Type": "application/json",
1978
+ "Accept": "application/hal+json"
1979
+ },
1980
+ "body": {
1981
+ "description": "a webhook",
1982
+ "events": [
1983
+ {
1984
+ "name": "contract_content_changed"
1985
+ }
1986
+ ],
1987
+ "request": {
1988
+ "url": "https://webhook",
1989
+ "method": "POST",
1990
+ "headers": {
1991
+ "Foo": "bar",
1992
+ "Bar": "foo"
1993
+ },
1994
+ "body": {
1995
+ "some": "body"
1996
+ },
1997
+ "username": "username",
1998
+ "password": "password"
1999
+ },
2000
+ "provider": {
2001
+ "name": "Pricing Service"
2002
+ },
2003
+ "consumer": {
2004
+ "name": "Condor"
2005
+ }
2006
+ }
2007
+ }
2008
+ ```
2009
+ Pact Broker will respond with:
2010
+ ```json
2011
+ {
2012
+ "status": 200,
2013
+ "headers": {
2014
+ "Content-Type": "application/hal+json;charset=utf-8"
2015
+ },
2016
+ "body": {
2017
+ "description": "a webhook",
2018
+ "_links": {
2019
+ "self": {
2020
+ "href": "http://localhost:1234/some-url",
2021
+ "title": "A title"
2022
+ }
2023
+ }
2024
+ }
2025
+ }
2026
+ ```
1803
2027
  <a name="an_invalid_request_to_create_a_webhook_for_a_consumer_and_provider_given_the_&#39;Pricing_Service&#39;_and_&#39;Condor&#39;_already_exist_in_the_pact-broker"></a>
1804
2028
  Given **the 'Pricing Service' and 'Condor' already exist in the pact-broker**, upon receiving **an invalid request to create a webhook for a consumer and provider** from Pact Broker Client, with
1805
2029
  ```json