pact_broker-client 1.32.0 → 1.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release_gem.yml +1 -0
  3. data/.github/workflows/test.yml +23 -0
  4. data/CHANGELOG.md +48 -0
  5. data/README.md +15 -3
  6. data/Rakefile +2 -0
  7. data/doc/pacts/markdown/Pact Broker Client - Pact Broker.md +331 -8
  8. data/lib/pact_broker/client.rb +1 -1
  9. data/lib/pact_broker/client/backports.rb +13 -0
  10. data/lib/pact_broker/client/cli/broker.rb +73 -28
  11. data/lib/pact_broker/client/cli/can_i_deploy_long_desc.txt +18 -9
  12. data/lib/pact_broker/client/cli/custom_thor.rb +9 -12
  13. data/lib/pact_broker/client/git.rb +43 -22
  14. data/lib/pact_broker/client/hal/entity.rb +27 -3
  15. data/lib/pact_broker/client/hal/http_client.rb +4 -0
  16. data/lib/pact_broker/client/hal/links.rb +39 -0
  17. data/lib/pact_broker/client/hal_client_methods.rb +11 -0
  18. data/lib/pact_broker/client/hash_refinements.rb +19 -0
  19. data/lib/pact_broker/client/matrix.rb +2 -1
  20. data/lib/pact_broker/client/matrix/text_formatter.rb +46 -11
  21. data/lib/pact_broker/client/publish_pacts.rb +93 -14
  22. data/lib/pact_broker/client/tasks/publication_task.rb +37 -6
  23. data/lib/pact_broker/client/version.rb +1 -1
  24. data/lib/pact_broker/client/versions/record_deployment.rb +109 -0
  25. data/pact-broker-client.gemspec +2 -0
  26. data/script/publish-pact.sh +7 -1
  27. data/script/trigger-release.sh +1 -1
  28. data/spec/lib/pact_broker/client/cli/broker_can_i_deploy_spec.rb +13 -2
  29. data/spec/lib/pact_broker/client/cli/broker_publish_spec.rb +108 -12
  30. data/spec/lib/pact_broker/client/git_spec.rb +39 -2
  31. data/spec/lib/pact_broker/client/hal/entity_spec.rb +4 -3
  32. data/spec/lib/pact_broker/client/matrix/text_formatter_spec.rb +29 -4
  33. data/spec/lib/pact_broker/client/publish_pacts_spec.rb +119 -7
  34. data/spec/lib/pact_broker/client/tasks/publication_task_spec.rb +88 -10
  35. data/spec/lib/pact_broker/client/versions/describe_spec.rb +0 -1
  36. data/spec/lib/pact_broker/client/versions/record_deployment_spec.rb +82 -0
  37. data/spec/pacts/pact_broker_client-pact_broker.json +335 -8
  38. data/spec/service_providers/pact_broker_client_create_version_spec.rb +89 -0
  39. data/spec/service_providers/pact_broker_client_matrix_spec.rb +4 -0
  40. data/spec/service_providers/pact_broker_client_versions_spec.rb +1 -2
  41. data/spec/service_providers/record_deployment_spec.rb +219 -0
  42. data/spec/support/matrix.json +6 -1
  43. data/spec/support/matrix.txt +3 -3
  44. data/spec/support/matrix_error.txt +3 -3
  45. data/spec/support/matrix_with_results.txt +10 -0
  46. data/tasks/pact.rake +2 -0
  47. metadata +44 -4
  48. data/.travis.yml +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9fc996a2d95d7c3755d063cd244b273fa5924f6956cf18b26ebe9531fa59e304
4
- data.tar.gz: '018d1d764a83f040d57d6ef504a6b4229f34f3fff38cf938c8c3f2202e03cc7a'
3
+ metadata.gz: 780fdf6ce281a9e3d94de58bb68705d0aa4b9b9fb7262ae1331c246c8dda5d6a
4
+ data.tar.gz: f15abe101f78db4245f654f2f2717d8b78be861146769c83e32a655e43c3ecc8
5
5
  SHA512:
6
- metadata.gz: 95944c92c42aa29803c5bd37b5b4c8526359cb910c4a983123379ac2f0482483aae75fc9179d2e6341e1931019c3f1588e1d7a385ffa628c203fd829d3137bfb
7
- data.tar.gz: 5391400fa12118608718161c3ea286ffe1b3b7aebbe1eca074b999b1903b25f6a3f15e257459e35240e30faf768949d45c45a052616378507b0eaf970590ee1b
6
+ metadata.gz: 27c3f50858c65ea0fc07a0b88c8eee758cfeb09f37c81d01d767a040ad51b377b43dd6fc080e9ae4f08dae4d10c379a9cda9b9d1dc456f680e06f2fc87860543
7
+ data.tar.gz: 6ce9d5caf203b2b41d5fd665f84b43109bf0ebec81019bb2747de2723de6f0b60cc38ecadd6e6cad7a4cd43e625ea96c595475a9c8f48f8b75c3c1180ff960db
@@ -4,6 +4,7 @@ on:
4
4
  repository_dispatch:
5
5
  types:
6
6
  - release-triggered
7
+ workflow_dispatch:
7
8
 
8
9
  jobs:
9
10
  test:
@@ -0,0 +1,23 @@
1
+ name: Test
2
+
3
+ on: push
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: "ubuntu-latest"
8
+ continue-on-error: ${{ matrix.experimental }}
9
+ strategy:
10
+ fail-fast: false
11
+ matrix:
12
+ ruby_version: ["2.2", "2.7"]
13
+ experimental: [false]
14
+ include:
15
+ - ruby_version: "3.0"
16
+ experimental: true
17
+ steps:
18
+ - uses: actions/checkout@v2
19
+ - uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: ${{ matrix.ruby_version }}
22
+ - run: "bundle install"
23
+ - run: "bundle exec rake"
data/CHANGELOG.md CHANGED
@@ -1,3 +1,51 @@
1
+ <a name="v1.37.0"></a>
2
+ ### v1.37.0 (2021-03-01)
3
+
4
+ #### Features
5
+
6
+ * add record-deployment ([6e5e208](/../../commit/6e5e208))
7
+
8
+ #### Bug Fixes
9
+
10
+ * use refinement to add compact to Hash ([c2c1cab](/../../commit/c2c1cab))
11
+
12
+ <a name="v1.36.0"></a>
13
+ ### v1.36.0 (2021-02-21)
14
+
15
+ #### Features
16
+
17
+ * **can-i-deploy**
18
+ * add --to-environment option ([05ae44c](/../../commit/05ae44c))
19
+
20
+ * support version branch and build URL when publishing pacts ([a75f7df](/../../commit/a75f7df))
21
+
22
+ <a name="v1.35.0"></a>
23
+ ### v1.35.0 (2021-01-21)
24
+
25
+ #### Features
26
+
27
+ * **can-i-deploy**
28
+ * display links to verification results in the output of can-i-deploy when using text format ([976950d](/../../commit/976950d))
29
+
30
+ <a name="v1.34.0"></a>
31
+ ### v1.34.0 (2020-11-20)
32
+
33
+ #### Features
34
+
35
+ * **pact publish**
36
+ * strip new lines from version numbers and tags ([5842d24](/../../commit/5842d24))
37
+
38
+ * **publish**
39
+ * update output text when pact already exists and merging ([9b849d3](/../../commit/9b849d3))
40
+
41
+ <a name="v1.33.0"></a>
42
+ ### v1.33.0 (2020-11-10)
43
+
44
+ #### Features
45
+
46
+ * **publish**
47
+ * allow pacts to be merged on the server side ([bd80f10](/../../commit/bd80f10))
48
+
1
49
  <a name="v1.32.0"></a>
2
50
  ### v1.32.0 (2020-10-26)
3
51
 
data/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
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
- [![Build Status](https://travis-ci.org/pact-foundation/pact_broker-client.svg?branch=master)](https://travis-ci.org/pact-foundation/pact_broker-client)
5
+ ![Build status](https://github.com/pact-foundation/pact_broker-client/workflows/Test/badge.svg)
6
+
7
+ [![Gem Version](https://badge.fury.io/rb/pact_broker-client.svg)](http://badge.fury.io/rb/pact_broker-client)
6
8
 
7
9
  ![Trigger update to docs.pact.io](https://github.com/pact-foundation/pact_broker-client/workflows/Trigger%20update%20to%20docs.pact.io/badge.svg)
8
10
 
@@ -16,9 +18,19 @@ Download the latest [pact-ruby-standalone][pact-ruby-standalone] package. You do
16
18
 
17
19
  Add `gem 'pact_broker-client'` to your Gemfile and run `bundle install`, or install the gem directly by running `gem install pact_broker-client`.
18
20
 
21
+ ## Connecting to a Pact Broker with a self signed certificate
22
+
23
+ To connect to a Pact Broker that uses custom SSL cerificates, set the environment variable `$SSL_CERT_FILE` or `$SSL_CERT_DIR` to a path that contains the appropriate certificate. Read more at https://docs.pact.io/pact_broker/advanced_topics/using-tls#for-non-jvm
24
+
19
25
  ## Usage - CLI
20
26
 
21
- To connect to a Pact Broker that uses custom SSL cerificates, set the environment variable `$SSL_CERT_FILE` or `$SSL_CERT_DIR` to a path that contains the appropriate certificate.
27
+ The Pact Broker base URL can be specified either using the environment variable `$PACT_BROKER_BASE_URL` or the `-b` or `--broker-base-url` parameters.
28
+
29
+ Pact Broker authentication can be performed either using basic auth or a bearer token.
30
+
31
+ Basic auth parameters can be specified using the `$PACT_BROKER_USERNAME` and `$PACT_BROKER_PASSWORD` environment variables, or the `-u` or `--broker-username` and `-p` or `--broker-password` parameters.
32
+
33
+ Authentication using a bearer token can be specified using the environment variable `$PACT_BROKER_TOKEN` or the `-k` or `--broker-token` parameters. This authentication system is used by [Pactflow](pactflow.io).
22
34
 
23
35
  ### publish
24
36
 
@@ -188,7 +200,7 @@ Can I deploy all the applications in my monorepo to prod?
188
200
  --pacticipant B --version a7e28207 \
189
201
  --pacticipant C --version a7e28207 \
190
202
  --to prod \
191
- --broker-base-url BROKER_BASE_URL
203
+ --broker-base-url BROKER_BASE_URL
192
204
 
193
205
  Mobile provider use case - can I deploy version b80e7b1b of Bar, all versions of Foo with tag "prod", and the latest version tagged "prod" of any other automatically calculated dependencies together? (Eg. where Bar is a provider and Foo is a mobile consumer with multiple versions in production, and Bar also has its own providers it needs to be compatible with.)
194
206
 
data/Rakefile CHANGED
@@ -31,6 +31,8 @@ end
31
31
  desc 'List provider states'
32
32
  task 'pact:list_provider_states' do
33
33
  require 'json'
34
+ require 'pact_broker/client/backports'
35
+
34
36
  puts Dir.glob("spec/pacts/**.json").collect { | pact_file |
35
37
  puts pact_file
36
38
  JSON.parse(File.read(pact_file))['interactions'].collect{ | interaction| interaction['providerState'] }
@@ -2,6 +2,12 @@
2
2
 
3
3
  #### Requests from Pact Broker Client to Pact Broker
4
4
 
5
+ * [A request for a pacticipant version](#a_request_for_a_pacticipant_version_given_version_5556b8149bf8bac76bc30f50a8a2dd4c22c85f30_of_pacticipant_Foo_exists_with_2_environments_that_aren&#39;t_test_available_for_deployment) given version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with 2 environments that aren't test available for deployment
6
+
7
+ * [A request for a pacticipant version](#a_request_for_a_pacticipant_version_given_version_5556b8149bf8bac76bc30f50a8a2dd4c22c85f30_of_pacticipant_Foo_exists_with_a_test_environment_available_for_deployment) given version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for deployment
8
+
9
+ * [A request for a pacticipant version](#a_request_for_a_pacticipant_version_given_version_5556b8149bf8bac76bc30f50a8a2dd4c22c85f30_of_pacticipant_Foo_does_not_exist) given version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo does not exist
10
+
5
11
  * [A request for the compatibility matrix for a pacticipant that does not exist](#a_request_for_the_compatibility_matrix_for_a_pacticipant_that_does_not_exist)
6
12
 
7
13
  * [A request for the compatibility matrix for all versions of Foo and Bar](#a_request_for_the_compatibility_matrix_for_all_versions_of_Foo_and_Bar_given_the_pact_for_Foo_version_1.2.3_and_1.2.4_has_been_verified_by_Bar_version_4.5.6) given the pact for Foo version 1.2.3 and 1.2.4 has been verified by Bar version 4.5.6
@@ -20,6 +26,8 @@
20
26
 
21
27
  * [A request for the compatibility matrix where only the version of Foo is specified](#a_request_for_the_compatibility_matrix_where_only_the_version_of_Foo_is_specified_given_the_pact_for_Foo_version_1.2.3_has_been_verified_by_Bar_version_4.5.6_and_version_5.6.7) given the pact for Foo version 1.2.3 has been verified by Bar version 4.5.6 and version 5.6.7
22
28
 
29
+ * [A request for the environments](#a_request_for_the_environments_given_an_environment_with_name_test_exists) given an environment with name test exists
30
+
23
31
  * [A request for the index resource](#a_request_for_the_index_resource)
24
32
 
25
33
  * [A request for the index resource](#a_request_for_the_index_resource_given_the_pacticipant_relations_are_present) given the pacticipant relations are present
@@ -28,6 +36,10 @@
28
36
 
29
37
  * [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
30
38
 
39
+ * [A request for the index resource](#a_request_for_the_index_resource_given_the_pb:pacticipant-version_and_pb:environments_relations_exist_in_the_index_resource) given the pb:pacticipant-version and pb:environments relations exist in the index resource
40
+
41
+ * [A request for the index resource](#a_request_for_the_index_resource_given_the_pb:pacticipant-version_relation_exists_in_the_index_resource) given the pb:pacticipant-version relation exists in the index resource
42
+
31
43
  * [A request for the index resource with the webhook relation](#a_request_for_the_index_resource_with_the_webhook_relation)
32
44
 
33
45
  * [A request for the list of the latest pacts from all consumers for the Pricing Service'](#a_request_for_the_list_of_the_latest_pacts_from_all_consumers_for_the_Pricing_Service&#39;_given_a_latest_pact_between_Condor_and_the_Pricing_Service_exists) given a latest pact between Condor and the Pricing Service exists
@@ -42,6 +54,10 @@
42
54
 
43
55
  * [A request to create a pacticipant](#a_request_to_create_a_pacticipant)
44
56
 
57
+ * [A request to create a pacticipant version](#a_request_to_create_a_pacticipant_version_given_version_26f353580936ad3b9baddb17b00e84f33c69e7cb_of_pacticipant_Foo_does_exist) given version 26f353580936ad3b9baddb17b00e84f33c69e7cb of pacticipant Foo does exist
58
+
59
+ * [A request to create a pacticipant version](#a_request_to_create_a_pacticipant_version_given_version_26f353580936ad3b9baddb17b00e84f33c69e7cb_of_pacticipant_Foo_does_not_exist) given version 26f353580936ad3b9baddb17b00e84f33c69e7cb of pacticipant Foo does not exist
60
+
45
61
  * [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
46
62
 
47
63
  * [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 +92,8 @@
76
92
 
77
93
  * [A request to publish a pact with method put](#a_request_to_publish_a_pact_with_method_put_given_the_&#39;Pricing_Service&#39;_and_&#39;Condor&#39;_already_exist_in_the_pact-broker,_and_Condor_already_has_a_pact_published_for_version_1.3.0) given the 'Pricing Service' and 'Condor' already exist in the pact-broker, and Condor already has a pact published for version 1.3.0
78
94
 
95
+ * [A request to record a deployment](#a_request_to_record_a_deployment_given_version_5556b8149bf8bac76bc30f50a8a2dd4c22c85f30_of_pacticipant_Foo_exists_with_a_test_environment_available_for_deployment) given version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for deployment
96
+
79
97
  * [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;_already_exists_in_the_pact-broker) given the 'Pricing Service' already exists in the pact-broker
80
98
 
81
99
  * [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
@@ -108,6 +126,87 @@
108
126
 
109
127
  #### Interactions
110
128
 
129
+ <a name="a_request_for_a_pacticipant_version_given_version_5556b8149bf8bac76bc30f50a8a2dd4c22c85f30_of_pacticipant_Foo_exists_with_2_environments_that_aren&#39;t_test_available_for_deployment"></a>
130
+ Given **version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with 2 environments that aren't test available for deployment**, upon receiving **a request for a pacticipant version** from Pact Broker Client, with
131
+ ```json
132
+ {
133
+ "method": "GET",
134
+ "path": "/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-Foo-5556b8149bf8bac76bc30f50a8a2dd4c22c85f30",
135
+ "headers": {
136
+ "Accept": "application/hal+json"
137
+ }
138
+ }
139
+ ```
140
+ Pact Broker will respond with:
141
+ ```json
142
+ {
143
+ "status": 200,
144
+ "headers": {
145
+ "Content-Type": "application/hal+json;charset=utf-8"
146
+ },
147
+ "body": {
148
+ "_links": {
149
+ "pb:record-deployment": [
150
+ {
151
+ "name": "prod",
152
+ "href": "href"
153
+ },
154
+ {
155
+ "name": "dev",
156
+ "href": "href"
157
+ }
158
+ ]
159
+ }
160
+ }
161
+ }
162
+ ```
163
+ <a name="a_request_for_a_pacticipant_version_given_version_5556b8149bf8bac76bc30f50a8a2dd4c22c85f30_of_pacticipant_Foo_exists_with_a_test_environment_available_for_deployment"></a>
164
+ Given **version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for deployment**, upon receiving **a request for a pacticipant version** from Pact Broker Client, with
165
+ ```json
166
+ {
167
+ "method": "GET",
168
+ "path": "/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-Foo-5556b8149bf8bac76bc30f50a8a2dd4c22c85f30",
169
+ "headers": {
170
+ "Accept": "application/hal+json"
171
+ }
172
+ }
173
+ ```
174
+ Pact Broker will respond with:
175
+ ```json
176
+ {
177
+ "status": 200,
178
+ "headers": {
179
+ "Content-Type": "application/hal+json;charset=utf-8"
180
+ },
181
+ "body": {
182
+ "_links": {
183
+ "pb:record-deployment": [
184
+ {
185
+ "name": "test",
186
+ "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-RECORD-DEPLOYMENT-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST"
187
+ }
188
+ ]
189
+ }
190
+ }
191
+ }
192
+ ```
193
+ <a name="a_request_for_a_pacticipant_version_given_version_5556b8149bf8bac76bc30f50a8a2dd4c22c85f30_of_pacticipant_Foo_does_not_exist"></a>
194
+ Given **version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo does not exist**, upon receiving **a request for a pacticipant version** from Pact Broker Client, with
195
+ ```json
196
+ {
197
+ "method": "GET",
198
+ "path": "/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-Foo-5556b8149bf8bac76bc30f50a8a2dd4c22c85f30",
199
+ "headers": {
200
+ "Accept": "application/hal+json"
201
+ }
202
+ }
203
+ ```
204
+ Pact Broker will respond with:
205
+ ```json
206
+ {
207
+ "status": 404
208
+ }
209
+ ```
111
210
  <a name="a_request_for_the_compatibility_matrix_for_a_pacticipant_that_does_not_exist"></a>
112
211
  Upon receiving **a request for the compatibility matrix for a pacticipant that does not exist** from Pact Broker Client, with
113
212
  ```json
@@ -164,7 +263,12 @@ Pact Broker will respond with:
164
263
  },
165
264
  "verificationResult": {
166
265
  "verifiedAt": "2017-10-10T12:49:04+11:00",
167
- "success": true
266
+ "success": true,
267
+ "_links": {
268
+ "self": {
269
+ "href": "http://result"
270
+ }
271
+ }
168
272
  },
169
273
  "pact": {
170
274
  "createdAt": "2017-10-10T12:49:04+11:00"
@@ -185,7 +289,12 @@ Pact Broker will respond with:
185
289
  },
186
290
  "verificationResult": {
187
291
  "verifiedAt": "2017-10-10T12:49:04+11:00",
188
- "success": true
292
+ "success": true,
293
+ "_links": {
294
+ "self": {
295
+ "href": "http://result"
296
+ }
297
+ }
189
298
  },
190
299
  "pact": {
191
300
  "createdAt": "2017-10-10T12:49:04+11:00"
@@ -233,7 +342,12 @@ Pact Broker will respond with:
233
342
  },
234
343
  "verificationResult": {
235
344
  "verifiedAt": "2017-10-10T12:49:04+11:00",
236
- "success": true
345
+ "success": true,
346
+ "_links": {
347
+ "self": {
348
+ "href": "http://result"
349
+ }
350
+ }
237
351
  },
238
352
  "pact": {
239
353
  "createdAt": "2017-10-10T12:49:04+11:00"
@@ -281,7 +395,12 @@ Pact Broker will respond with:
281
395
  },
282
396
  "verificationResult": {
283
397
  "verifiedAt": "2017-10-10T12:49:04+11:00",
284
- "success": true
398
+ "success": true,
399
+ "_links": {
400
+ "self": {
401
+ "href": "http://result"
402
+ }
403
+ }
285
404
  },
286
405
  "pact": {
287
406
  "createdAt": "2017-10-10T12:49:04+11:00"
@@ -329,7 +448,12 @@ Pact Broker will respond with:
329
448
  },
330
449
  "verificationResult": {
331
450
  "verifiedAt": "2017-10-10T12:49:04+11:00",
332
- "success": true
451
+ "success": true,
452
+ "_links": {
453
+ "self": {
454
+ "href": "http://result"
455
+ }
456
+ }
333
457
  },
334
458
  "pact": {
335
459
  "createdAt": "2017-10-10T12:49:04+11:00"
@@ -413,7 +537,12 @@ Pact Broker will respond with:
413
537
  },
414
538
  "verificationResult": {
415
539
  "verifiedAt": "2017-10-10T12:49:04+11:00",
416
- "success": true
540
+ "success": true,
541
+ "_links": {
542
+ "self": {
543
+ "href": "http://result"
544
+ }
545
+ }
417
546
  },
418
547
  "pact": {
419
548
  "createdAt": "2017-10-10T12:49:04+11:00"
@@ -484,7 +613,12 @@ Pact Broker will respond with:
484
613
  },
485
614
  "verificationResult": {
486
615
  "verifiedAt": "2017-10-10T12:49:04+11:00",
487
- "success": true
616
+ "success": true,
617
+ "_links": {
618
+ "self": {
619
+ "href": "http://result"
620
+ }
621
+ }
488
622
  },
489
623
  "pact": {
490
624
  "createdAt": "2017-10-10T12:49:04+11:00"
@@ -494,6 +628,36 @@ Pact Broker will respond with:
494
628
  }
495
629
  }
496
630
  ```
631
+ <a name="a_request_for_the_environments_given_an_environment_with_name_test_exists"></a>
632
+ Given **an environment with name test exists**, upon receiving **a request for the environments** from Pact Broker Client, with
633
+ ```json
634
+ {
635
+ "method": "GET",
636
+ "path": "/HAL-REL-PLACEHOLDER-PB-ENVIRONMENTS",
637
+ "headers": {
638
+ "Accept": "application/hal+json"
639
+ }
640
+ }
641
+ ```
642
+ Pact Broker will respond with:
643
+ ```json
644
+ {
645
+ "status": 200,
646
+ "headers": {
647
+ "Content-Type": "application/hal+json;charset=utf-8"
648
+ },
649
+ "body": {
650
+ "_links": {
651
+ "pb:environments": [
652
+ {
653
+ "name": "test",
654
+ "href": "href"
655
+ }
656
+ ]
657
+ }
658
+ }
659
+ }
660
+ ```
497
661
  <a name="a_request_for_the_index_resource"></a>
498
662
  Upon receiving **a request for the index resource** from Pact Broker Client, with
499
663
  ```json
@@ -611,6 +775,63 @@ Pact Broker will respond with:
611
775
  }
612
776
  }
613
777
  ```
778
+ <a name="a_request_for_the_index_resource_given_the_pb:pacticipant-version_and_pb:environments_relations_exist_in_the_index_resource"></a>
779
+ Given **the pb:pacticipant-version and pb:environments relations exist in the index resource**, upon receiving **a request for the index resource** from Pact Broker Client, with
780
+ ```json
781
+ {
782
+ "method": "GET",
783
+ "path": "/",
784
+ "headers": {
785
+ "Accept": "application/hal+json"
786
+ }
787
+ }
788
+ ```
789
+ Pact Broker will respond with:
790
+ ```json
791
+ {
792
+ "status": 200,
793
+ "headers": {
794
+ "Content-Type": "application/hal+json;charset=utf-8"
795
+ },
796
+ "body": {
797
+ "_links": {
798
+ "pb:pacticipant-version": {
799
+ "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-{pacticipant}-{version}"
800
+ },
801
+ "pb:environments": {
802
+ "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-ENVIRONMENTS"
803
+ }
804
+ }
805
+ }
806
+ }
807
+ ```
808
+ <a name="a_request_for_the_index_resource_given_the_pb:pacticipant-version_relation_exists_in_the_index_resource"></a>
809
+ Given **the pb:pacticipant-version relation exists in the index resource**, upon receiving **a request for the index resource** from Pact Broker Client, with
810
+ ```json
811
+ {
812
+ "method": "get",
813
+ "path": "/",
814
+ "headers": {
815
+ "Accept": "application/hal+json"
816
+ }
817
+ }
818
+ ```
819
+ Pact Broker will respond with:
820
+ ```json
821
+ {
822
+ "status": 200,
823
+ "headers": {
824
+ "Content-Type": "application/hal+json;charset=utf-8"
825
+ },
826
+ "body": {
827
+ "_links": {
828
+ "pb:pacticipant-version": {
829
+ "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-INDEX-PB-PACTICIPANT-VERSION-{pacticipant}-{version}"
830
+ }
831
+ }
832
+ }
833
+ }
834
+ ```
614
835
  <a name="a_request_for_the_index_resource_with_the_webhook_relation"></a>
615
836
  Upon receiving **a request for the index resource with the webhook relation** from Pact Broker Client, with
616
837
  ```json
@@ -735,7 +956,12 @@ Pact Broker will respond with:
735
956
  },
736
957
  "verificationResult": {
737
958
  "verifiedAt": "2017-10-10T12:49:04+11:00",
738
- "success": true
959
+ "success": true,
960
+ "_links": {
961
+ "self": {
962
+ "href": "http://result"
963
+ }
964
+ }
739
965
  },
740
966
  "pact": {
741
967
  "createdAt": "2017-10-10T12:49:04+11:00"
@@ -858,6 +1084,76 @@ Pact Broker will respond with:
858
1084
  }
859
1085
  }
860
1086
  ```
1087
+ <a name="a_request_to_create_a_pacticipant_version_given_version_26f353580936ad3b9baddb17b00e84f33c69e7cb_of_pacticipant_Foo_does_exist"></a>
1088
+ Given **version 26f353580936ad3b9baddb17b00e84f33c69e7cb of pacticipant Foo does exist**, upon receiving **a request to create a pacticipant version** from Pact Broker Client, with
1089
+ ```json
1090
+ {
1091
+ "method": "put",
1092
+ "path": "/HAL-REL-PLACEHOLDER-INDEX-PB-PACTICIPANT-VERSION-Foo-26f353580936ad3b9baddb17b00e84f33c69e7cb",
1093
+ "headers": {
1094
+ "Content-Type": "application/json",
1095
+ "Accept": "application/hal+json"
1096
+ },
1097
+ "body": {
1098
+ "branch": "main",
1099
+ "buildUrl": "http://my-ci/builds/1"
1100
+ }
1101
+ }
1102
+ ```
1103
+ Pact Broker will respond with:
1104
+ ```json
1105
+ {
1106
+ "status": 200,
1107
+ "headers": {
1108
+ "Content-Type": "application/hal+json;charset=utf-8"
1109
+ },
1110
+ "body": {
1111
+ "number": "26f353580936ad3b9baddb17b00e84f33c69e7cb",
1112
+ "branch": "main",
1113
+ "buildUrl": "http://my-ci/builds/1",
1114
+ "_links": {
1115
+ "self": {
1116
+ "href": "http://localhost:1234/some-url"
1117
+ }
1118
+ }
1119
+ }
1120
+ }
1121
+ ```
1122
+ <a name="a_request_to_create_a_pacticipant_version_given_version_26f353580936ad3b9baddb17b00e84f33c69e7cb_of_pacticipant_Foo_does_not_exist"></a>
1123
+ Given **version 26f353580936ad3b9baddb17b00e84f33c69e7cb of pacticipant Foo does not exist**, upon receiving **a request to create a pacticipant version** from Pact Broker Client, with
1124
+ ```json
1125
+ {
1126
+ "method": "put",
1127
+ "path": "/HAL-REL-PLACEHOLDER-INDEX-PB-PACTICIPANT-VERSION-Foo-26f353580936ad3b9baddb17b00e84f33c69e7cb",
1128
+ "headers": {
1129
+ "Content-Type": "application/json",
1130
+ "Accept": "application/hal+json"
1131
+ },
1132
+ "body": {
1133
+ "branch": "main",
1134
+ "buildUrl": "http://my-ci/builds/1"
1135
+ }
1136
+ }
1137
+ ```
1138
+ Pact Broker will respond with:
1139
+ ```json
1140
+ {
1141
+ "status": 201,
1142
+ "headers": {
1143
+ "Content-Type": "application/hal+json;charset=utf-8"
1144
+ },
1145
+ "body": {
1146
+ "number": "26f353580936ad3b9baddb17b00e84f33c69e7cb",
1147
+ "branch": "main",
1148
+ "buildUrl": "http://my-ci/builds/1",
1149
+ "_links": {
1150
+ "self": {
1151
+ "href": "http://localhost:1234/some-url"
1152
+ }
1153
+ }
1154
+ }
1155
+ }
1156
+ ```
861
1157
  <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>
862
1158
  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
863
1159
  ```json
@@ -1632,6 +1928,33 @@ Pact Broker will respond with:
1632
1928
  }
1633
1929
  }
1634
1930
  ```
1931
+ <a name="a_request_to_record_a_deployment_given_version_5556b8149bf8bac76bc30f50a8a2dd4c22c85f30_of_pacticipant_Foo_exists_with_a_test_environment_available_for_deployment"></a>
1932
+ Given **version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for deployment**, upon receiving **a request to record a deployment** from Pact Broker Client, with
1933
+ ```json
1934
+ {
1935
+ "method": "POST",
1936
+ "path": "/HAL-REL-PLACEHOLDER-PB-RECORD-DEPLOYMENT-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST",
1937
+ "headers": {
1938
+ "Content-Type": "application/json",
1939
+ "Accept": "application/hal+json"
1940
+ },
1941
+ "body": {
1942
+ "replacedPreviousDeployedVersion": true
1943
+ }
1944
+ }
1945
+ ```
1946
+ Pact Broker will respond with:
1947
+ ```json
1948
+ {
1949
+ "status": 201,
1950
+ "headers": {
1951
+ "Content-Type": "application/hal+json;charset=utf-8"
1952
+ },
1953
+ "body": {
1954
+ "replacedPreviousDeployedVersion": true
1955
+ }
1956
+ }
1957
+ ```
1635
1958
  <a name="a_request_to_register_the_repository_URL_of_a_pacticipant_given_the_&#39;Pricing_Service&#39;_already_exists_in_the_pact-broker"></a>
1636
1959
  Given **the 'Pricing Service' already exists in the pact-broker**, upon receiving **a request to register the repository URL of a pacticipant** from Pact Broker Client, with
1637
1960
  ```json