pact_broker-client 1.38.2 → 1.42.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +47 -0
- data/Gemfile +4 -0
- data/README.md +18 -0
- data/doc/pacts/markdown/Pact Broker Client - Pact Broker.md +61 -140
- data/example/scripts/publish-pact.sh +1 -1
- data/lib/pact_broker/client/backports.rb +9 -0
- data/lib/pact_broker/client/base_client.rb +1 -1
- data/lib/pact_broker/client/base_command.rb +95 -0
- data/lib/pact_broker/client/can_i_deploy.rb +20 -3
- data/lib/pact_broker/client/cli/broker.rb +44 -28
- data/lib/pact_broker/client/cli/custom_thor.rb +12 -0
- data/lib/pact_broker/client/cli/environment_commands.rb +70 -0
- data/lib/pact_broker/client/cli/pacticipant_commands.rb +44 -0
- data/lib/pact_broker/client/cli/record_deployment_long_desc.txt +0 -0
- data/lib/pact_broker/client/cli/version_selector_options_parser.rb +4 -0
- data/lib/pact_broker/client/colorize_notices.rb +31 -0
- data/lib/pact_broker/client/environments.rb +3 -0
- data/lib/pact_broker/client/environments/create_environment.rb +31 -0
- data/lib/pact_broker/client/environments/delete_environment.rb +27 -0
- data/lib/pact_broker/client/environments/describe_environment.rb +36 -0
- data/lib/pact_broker/client/environments/environment_command.rb +66 -0
- data/lib/pact_broker/client/environments/list_environments.rb +30 -0
- data/lib/pact_broker/client/environments/text_formatter.rb +30 -0
- data/lib/pact_broker/client/environments/update_environment.rb +31 -0
- data/lib/pact_broker/client/generate_display_name.rb +27 -0
- data/lib/pact_broker/client/hal/entity.rb +26 -3
- data/lib/pact_broker/client/hal/http_client.rb +11 -2
- data/lib/pact_broker/client/hal/link.rb +20 -0
- data/lib/pact_broker/client/hal/links.rb +15 -0
- data/lib/pact_broker/client/hal_client_methods.rb +9 -3
- data/lib/pact_broker/client/matrix.rb +4 -0
- data/lib/pact_broker/client/matrix/abbreviate_version_number.rb +15 -0
- data/lib/pact_broker/client/matrix/resource.rb +26 -1
- data/lib/pact_broker/client/matrix/text_formatter.rb +28 -17
- data/lib/pact_broker/client/pacticipants.rb +6 -0
- data/lib/pact_broker/client/pacticipants/create.rb +24 -34
- data/lib/pact_broker/client/pacticipants/list.rb +34 -0
- data/lib/pact_broker/client/pacticipants/text_formatter.rb +41 -0
- data/lib/pact_broker/client/pacts.rb +0 -1
- data/lib/pact_broker/client/publish_pacts.rb +94 -128
- data/lib/pact_broker/client/publish_pacts_the_old_way.rb +194 -0
- data/lib/pact_broker/client/string_refinements.rb +56 -0
- data/lib/pact_broker/client/tasks/publication_task.rb +3 -3
- data/lib/pact_broker/client/version.rb +1 -1
- data/lib/pact_broker/client/versions/record_deployment.rb +6 -6
- data/lib/pact_broker/client/versions/record_undeployment.rb +45 -68
- data/pact-broker-client.gemspec +2 -0
- data/script/approve-all.sh +6 -0
- data/script/publish-pact.sh +36 -5
- data/script/record-deployment.sh +1 -3
- data/script/record-undeployment.sh +4 -0
- data/spec/fixtures/approvals/can_i_deploy_ignore.approved.txt +13 -0
- data/spec/fixtures/approvals/describe_environment.approved.txt +7 -0
- data/spec/fixtures/approvals/list_environments.approved.txt +3 -0
- data/spec/fixtures/foo-bar.json +31 -0
- data/spec/lib/pact_broker/client/can_i_deploy_spec.rb +47 -5
- data/spec/lib/pact_broker/client/cli/broker_can_i_deploy_spec.rb +5 -5
- data/spec/lib/pact_broker/client/cli/broker_publish_spec.rb +36 -7
- data/spec/lib/pact_broker/client/cli/broker_run_webhook_commands_spec.rb +3 -3
- data/spec/lib/pact_broker/client/cli/version_selector_options_parser_spec.rb +21 -0
- data/spec/lib/pact_broker/client/environments/delete_environment_spec.rb +120 -0
- data/spec/lib/pact_broker/client/environments/describe_environment_spec.rb +89 -0
- data/spec/lib/pact_broker/client/environments/update_environment_spec.rb +167 -0
- data/spec/lib/pact_broker/client/generate_display_name_spec.rb +39 -0
- data/spec/lib/pact_broker/client/hal/entity_spec.rb +2 -2
- data/spec/lib/pact_broker/client/pacticipants/create_spec.rb +5 -2
- data/spec/lib/pact_broker/client/{publish_pacts_spec.rb → publish_pacts_the_old_way_spec.rb} +10 -9
- data/spec/lib/pact_broker/client/tasks/publication_task_spec.rb +18 -12
- data/spec/lib/pact_broker/client/versions/record_deployment_spec.rb +5 -5
- data/spec/pacts/pact_broker_client-pact_broker.json +50 -124
- data/spec/service_providers/create_environment_spec.rb +78 -0
- data/spec/service_providers/list_environments_spec.rb +77 -0
- data/spec/service_providers/pact_broker_client_create_version_spec.rb +4 -4
- data/spec/service_providers/pact_broker_client_matrix_ignore_spec.rb +98 -0
- data/spec/service_providers/pacticipants_create_spec.rb +5 -4
- data/spec/service_providers/publish_pacts_spec.rb +116 -0
- data/spec/service_providers/record_deployment_spec.rb +6 -7
- data/spec/spec_helper.rb +3 -1
- data/spec/support/approvals.rb +26 -0
- data/spec/support/shared_context.rb +6 -2
- metadata +86 -5
@@ -5,11 +5,14 @@ module PactBroker
|
|
5
5
|
module Pacticipants2
|
6
6
|
describe Create do
|
7
7
|
describe ".call" do
|
8
|
-
|
8
|
+
before do
|
9
|
+
allow_any_instance_of(PactBroker::Client::Hal::HttpClient).to receive(:sleep)
|
10
|
+
end
|
11
|
+
let(:pact_broker_client_options) { { pact_broker_base_url: broker_base_url} }
|
9
12
|
let(:broker_base_url) { "http://url" }
|
10
13
|
let(:params) { { name: 'Foo' } }
|
11
14
|
|
12
|
-
subject { Create.call(params,
|
15
|
+
subject { Create.call(params, {}, pact_broker_client_options)}
|
13
16
|
|
14
17
|
context "when there is an http error" do
|
15
18
|
let!(:index_request) do
|
data/spec/lib/pact_broker/client/{publish_pacts_spec.rb → publish_pacts_the_old_way_spec.rb}
RENAMED
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'fakefs/safe'
|
3
|
-
require 'pact_broker/client/
|
3
|
+
require 'pact_broker/client/publish_pacts_the_old_way'
|
4
4
|
require 'json'
|
5
5
|
|
6
6
|
module PactBroker
|
7
7
|
module Client
|
8
|
-
describe
|
8
|
+
describe PublishPactsTheOldWay do
|
9
9
|
|
10
10
|
# The amount of stubbing that we have to do here indicates this class is doing
|
11
11
|
# TOO MUCH and needs to be split up!
|
@@ -23,7 +23,7 @@ module PactBroker
|
|
23
23
|
File.open("spec/pacts/consumer-provider.json", "w") { |file| file << pact_hash.to_json }
|
24
24
|
File.open("spec/pacts/consumer-provider-2.json", "w") { |file| file << pact_hash.to_json }
|
25
25
|
File.open("spec/pacts/foo-bar.json", "w") { |file| file << pact_hash_2.to_json }
|
26
|
-
allow_any_instance_of(
|
26
|
+
allow_any_instance_of(PublishPactsTheOldWay).to receive(:create_index_entry_point).and_return(index_entry_point)
|
27
27
|
end
|
28
28
|
|
29
29
|
after do
|
@@ -63,8 +63,9 @@ module PactBroker
|
|
63
63
|
let(:index_entry_point) { instance_double("PactBroker::Client::Hal::EntryPoint", :get! => index_resource )}
|
64
64
|
let(:index_resource) { instance_double("PactBroker::Client::Hal::Entity", can?: can_create_version ) }
|
65
65
|
let(:can_create_version) { false }
|
66
|
+
let(:options) { {} }
|
66
67
|
|
67
|
-
subject {
|
68
|
+
subject { PublishPactsTheOldWay.new(pact_broker_base_url, pact_file_paths, consumer_version_params, options, pact_broker_client_options) }
|
68
69
|
|
69
70
|
describe "call" do
|
70
71
|
it "creates a PactBroker Client" do
|
@@ -85,7 +86,7 @@ module PactBroker
|
|
85
86
|
end
|
86
87
|
|
87
88
|
it "returns true" do
|
88
|
-
expect(subject.call).to
|
89
|
+
expect(subject.call.success).to eq true
|
89
90
|
end
|
90
91
|
end
|
91
92
|
|
@@ -140,7 +141,7 @@ module PactBroker
|
|
140
141
|
end
|
141
142
|
|
142
143
|
it "returns false" do
|
143
|
-
expect(subject.call).to be false
|
144
|
+
expect(subject.call.success).to be false
|
144
145
|
end
|
145
146
|
end
|
146
147
|
|
@@ -212,7 +213,7 @@ module PactBroker
|
|
212
213
|
end
|
213
214
|
|
214
215
|
it "returns false" do
|
215
|
-
expect(subject.call).to eq false
|
216
|
+
expect(subject.call.success).to eq false
|
216
217
|
end
|
217
218
|
end
|
218
219
|
end
|
@@ -230,7 +231,7 @@ module PactBroker
|
|
230
231
|
end
|
231
232
|
|
232
233
|
it "returns false" do
|
233
|
-
expect(subject.call).to eq false
|
234
|
+
expect(subject.call.success).to eq false
|
234
235
|
end
|
235
236
|
end
|
236
237
|
|
@@ -255,7 +256,7 @@ module PactBroker
|
|
255
256
|
end
|
256
257
|
|
257
258
|
it "returns true" do
|
258
|
-
expect(subject.call).to eq true
|
259
|
+
expect(subject.call.success).to eq true
|
259
260
|
end
|
260
261
|
end
|
261
262
|
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'pact_broker/client/tasks/publication_task'
|
3
3
|
require 'pact_broker/client/publish_pacts'
|
4
|
+
require 'pact_broker/client/command_result'
|
4
5
|
|
5
6
|
module PactBroker::Client
|
6
7
|
describe PublicationTask do
|
@@ -9,13 +10,16 @@ module PactBroker::Client
|
|
9
10
|
@consumer_version = "1.2.3"
|
10
11
|
end
|
11
12
|
|
12
|
-
let(:publish_pacts) { instance_double("PactBroker::ClientSupport::PublishPacts", call:
|
13
|
+
let(:publish_pacts) { instance_double("PactBroker::ClientSupport::PublishPacts", call: result)}
|
13
14
|
let(:pact_file_list) { ['spec/pact/consumer-provider.json'] }
|
15
|
+
let(:success) { true }
|
16
|
+
let(:result) { instance_double(PactBroker::Client::CommandResult, success: success, message: "message")}
|
14
17
|
|
15
18
|
before do
|
16
19
|
allow(PactBroker::Client::PublishPacts).to receive(:new).and_return(publish_pacts)
|
17
20
|
allow(FileList).to receive(:[]).with(pattern).and_return(pact_file_list)
|
18
21
|
allow(PactBroker::Client::Git).to receive(:branch).and_return('foo')
|
22
|
+
allow($stdout).to receive(:puts)
|
19
23
|
end
|
20
24
|
|
21
25
|
let(:pattern) { "spec/pacts/*.json" }
|
@@ -29,15 +33,16 @@ module PactBroker::Client
|
|
29
33
|
|
30
34
|
context "when pacts are succesfully published" do
|
31
35
|
it "invokes PublishPacts with the default values" do
|
32
|
-
expect(PactBroker::Client::PublishPacts).to receive(:new).with('http://pact-broker', pact_file_list, { number: '1.2.3', branch: "foo", tags: [], version_required: false}, {}).and_return(publish_pacts)
|
33
|
-
expect(publish_pacts).to receive(:call).and_return(
|
36
|
+
expect(PactBroker::Client::PublishPacts).to receive(:new).with('http://pact-broker', pact_file_list, { number: '1.2.3', branch: "foo", tags: [], version_required: false}, {}, {}).and_return(publish_pacts)
|
37
|
+
expect(publish_pacts).to receive(:call).and_return(result)
|
34
38
|
Rake::Task['pact:publish'].execute
|
35
39
|
end
|
36
40
|
end
|
37
41
|
|
38
42
|
context "when a pact fails to be published" do
|
43
|
+
let(:success) { false }
|
44
|
+
|
39
45
|
it "raises an error" do
|
40
|
-
expect(publish_pacts).to receive(:call).and_return(false)
|
41
46
|
expect { Rake::Task['pact:publish'].execute }.to raise_error("One or more pacts failed to be published")
|
42
47
|
end
|
43
48
|
end
|
@@ -52,8 +57,8 @@ module PactBroker::Client
|
|
52
57
|
end
|
53
58
|
|
54
59
|
it "invokes PublishPacts with the write method set" do
|
55
|
-
expect(PactBroker::Client::PublishPacts).to receive(:new).with('http://pact-broker', pact_file_list, { number: "1.2.3", branch: "foo", tags: [], version_required: false }, {write: :merge}).and_return(publish_pacts)
|
56
|
-
expect(publish_pacts).to receive(:call).and_return(
|
60
|
+
expect(PactBroker::Client::PublishPacts).to receive(:new).with('http://pact-broker', pact_file_list, { number: "1.2.3", branch: "foo", tags: [], version_required: false }, {}, {write: :merge}).and_return(publish_pacts)
|
61
|
+
expect(publish_pacts).to receive(:call).and_return(result)
|
57
62
|
Rake::Task['pact:publish:merge'].execute
|
58
63
|
end
|
59
64
|
end
|
@@ -74,7 +79,7 @@ module PactBroker::Client
|
|
74
79
|
end
|
75
80
|
|
76
81
|
it "invokes PublishPacts with the git branch name as a tag" do
|
77
|
-
expect(PactBroker::Client::PublishPacts).to receive(:new).with(anything, anything, hash_including(tags: ['bar', 'foo']), anything).and_return(publish_pacts)
|
82
|
+
expect(PactBroker::Client::PublishPacts).to receive(:new).with(anything, anything, hash_including(tags: ['bar', 'foo']), anything, anything).and_return(publish_pacts)
|
78
83
|
Rake::Task['pact:publish:git_branch'].execute
|
79
84
|
end
|
80
85
|
end
|
@@ -93,7 +98,7 @@ module PactBroker::Client
|
|
93
98
|
end
|
94
99
|
|
95
100
|
it "invokes PublishPacts with the branch name" do
|
96
|
-
expect(PactBroker::Client::PublishPacts).to receive(:new).with(anything, anything, hash_including(branch: "foo"), anything).and_return(publish_pacts)
|
101
|
+
expect(PactBroker::Client::PublishPacts).to receive(:new).with(anything, anything, hash_including(branch: "foo"), anything, anything).and_return(publish_pacts)
|
97
102
|
Rake::Task['pact:publish:git_branch_auto_detect_true'].execute
|
98
103
|
end
|
99
104
|
end
|
@@ -113,7 +118,7 @@ module PactBroker::Client
|
|
113
118
|
end
|
114
119
|
|
115
120
|
it "invokes PublishPacts with the specified branch name" do
|
116
|
-
expect(PactBroker::Client::PublishPacts).to receive(:new).with(anything, anything, hash_including(branch: "main"), anything).and_return(publish_pacts)
|
121
|
+
expect(PactBroker::Client::PublishPacts).to receive(:new).with(anything, anything, hash_including(branch: "main"), anything, anything).and_return(publish_pacts)
|
117
122
|
Rake::Task['pact:publish:git_branch_auto_detect_true_with_branch'].execute
|
118
123
|
end
|
119
124
|
end
|
@@ -132,7 +137,7 @@ module PactBroker::Client
|
|
132
137
|
end
|
133
138
|
|
134
139
|
it "invokes PublishPacts without the branch name" do
|
135
|
-
expect(PactBroker::Client::PublishPacts).to receive(:new).with(anything, anything, hash_not_including(branch: "foo"), anything).and_return(publish_pacts)
|
140
|
+
expect(PactBroker::Client::PublishPacts).to receive(:new).with(anything, anything, hash_not_including(branch: "foo"), anything, anything).and_return(publish_pacts)
|
136
141
|
Rake::Task['pact:publish:git_branch_auto_detect_false'].execute
|
137
142
|
end
|
138
143
|
end
|
@@ -150,7 +155,7 @@ module PactBroker::Client
|
|
150
155
|
end
|
151
156
|
|
152
157
|
it "invokes PublishPacts with the branch name" do
|
153
|
-
expect(PactBroker::Client::PublishPacts).to receive(:new).with(anything, anything, hash_including(branch: "foo"), anything).and_return(publish_pacts)
|
158
|
+
expect(PactBroker::Client::PublishPacts).to receive(:new).with(anything, anything, hash_including(branch: "foo"),anything, anything).and_return(publish_pacts)
|
154
159
|
Rake::Task['pact:publish:git_branch_auto_detect_default'].execute
|
155
160
|
end
|
156
161
|
end
|
@@ -180,9 +185,10 @@ module PactBroker::Client
|
|
180
185
|
@pact_broker_base_url,
|
181
186
|
pact_file_list,
|
182
187
|
{ number: "1.2.3", tags: [@tag], branch: "foo", version_required: false},
|
188
|
+
{},
|
183
189
|
{ basic_auth: @pact_broker_basic_auth, token: @pact_broker_token }
|
184
190
|
)
|
185
|
-
expect(publish_pacts).to receive(:call).and_return(
|
191
|
+
expect(publish_pacts).to receive(:call).and_return(result)
|
186
192
|
Rake::Task['pact:publish:custom'].execute
|
187
193
|
end
|
188
194
|
end
|
@@ -15,14 +15,14 @@ module PactBroker
|
|
15
15
|
stub_request(:get, broker_base_url).to_return(status: 200, body: index_body_hash.to_json, headers: { "Content-Type" => "application/hal+json" } )
|
16
16
|
end
|
17
17
|
|
18
|
-
let(:
|
18
|
+
let(:target) { "blue" }
|
19
19
|
|
20
20
|
let(:params) do
|
21
21
|
{
|
22
22
|
pacticipant_name: "Foo",
|
23
23
|
version_number: "1",
|
24
24
|
environment_name: "test",
|
25
|
-
|
25
|
+
target: target,
|
26
26
|
output: "text"
|
27
27
|
}
|
28
28
|
end
|
@@ -53,11 +53,11 @@ module PactBroker
|
|
53
53
|
end
|
54
54
|
|
55
55
|
it "indicates the API was Pactflow" do
|
56
|
-
expect(subject.message).to include "Recorded deployment of Foo version 1 to test in Pactflow"
|
56
|
+
expect(subject.message).to include "Recorded deployment of Foo version 1 to test (target blue) in Pactflow"
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
context "when
|
60
|
+
context "when target is false" do
|
61
61
|
before do
|
62
62
|
allow_any_instance_of(RecordDeployment).to receive(:check_if_command_supported)
|
63
63
|
allow_any_instance_of(RecordDeployment).to receive(:check_environment_exists)
|
@@ -65,7 +65,7 @@ module PactBroker
|
|
65
65
|
allow_any_instance_of(RecordDeployment).to receive(:pact_broker_name).and_return("")
|
66
66
|
end
|
67
67
|
|
68
|
-
let(:
|
68
|
+
let(:target) { false }
|
69
69
|
|
70
70
|
let(:deployed_version_resource) do
|
71
71
|
double('PactBroker::Client::Hal::Entity', response: double('response', headers: response_headers) )
|
@@ -1552,7 +1552,7 @@
|
|
1552
1552
|
},
|
1553
1553
|
{
|
1554
1554
|
"description": "a request for the index resource",
|
1555
|
-
"providerState": "the pb:
|
1555
|
+
"providerState": "the pb:publish-contracts relations exists in the index resource",
|
1556
1556
|
"request": {
|
1557
1557
|
"method": "GET",
|
1558
1558
|
"path": "/",
|
@@ -1567,20 +1567,13 @@
|
|
1567
1567
|
},
|
1568
1568
|
"body": {
|
1569
1569
|
"_links": {
|
1570
|
-
"pb:
|
1571
|
-
"href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-
|
1572
|
-
},
|
1573
|
-
"pb:environments": {
|
1574
|
-
"href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-ENVIRONMENTS"
|
1570
|
+
"pb:publish-contracts": {
|
1571
|
+
"href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-PUBLISH-CONTRACTS"
|
1575
1572
|
}
|
1576
1573
|
}
|
1577
1574
|
},
|
1578
1575
|
"matchingRules": {
|
1579
|
-
"$.body._links.pb:
|
1580
|
-
"match": "regex",
|
1581
|
-
"regex": "http:\\/\\/.*{pacticipant}.*{version}"
|
1582
|
-
},
|
1583
|
-
"$.body._links.pb:environments.href": {
|
1576
|
+
"$.body._links.pb:publish-contracts.href": {
|
1584
1577
|
"match": "regex",
|
1585
1578
|
"regex": "http:\\/\\/.*"
|
1586
1579
|
}
|
@@ -1588,86 +1581,33 @@
|
|
1588
1581
|
}
|
1589
1582
|
},
|
1590
1583
|
{
|
1591
|
-
"description": "a request
|
1592
|
-
"providerState": "version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for deployment",
|
1593
|
-
"request": {
|
1594
|
-
"method": "GET",
|
1595
|
-
"path": "/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-Foo-5556b8149bf8bac76bc30f50a8a2dd4c22c85f30",
|
1596
|
-
"headers": {
|
1597
|
-
"Accept": "application/hal+json"
|
1598
|
-
}
|
1599
|
-
},
|
1600
|
-
"response": {
|
1601
|
-
"status": 200,
|
1602
|
-
"headers": {
|
1603
|
-
"Content-Type": "application/hal+json;charset=utf-8"
|
1604
|
-
},
|
1605
|
-
"body": {
|
1606
|
-
"_links": {
|
1607
|
-
"pb:record-deployment": [
|
1608
|
-
{
|
1609
|
-
"name": "test",
|
1610
|
-
"href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-RECORD-DEPLOYMENT-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST"
|
1611
|
-
}
|
1612
|
-
]
|
1613
|
-
}
|
1614
|
-
},
|
1615
|
-
"matchingRules": {
|
1616
|
-
"$.body._links.pb:record-deployment[0].href": {
|
1617
|
-
"match": "regex",
|
1618
|
-
"regex": "http:\\/\\/.*"
|
1619
|
-
}
|
1620
|
-
}
|
1621
|
-
}
|
1622
|
-
},
|
1623
|
-
{
|
1624
|
-
"description": "a request to record a deployment",
|
1625
|
-
"providerState": "version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for deployment",
|
1584
|
+
"description": "a request to publish contracts",
|
1626
1585
|
"request": {
|
1627
1586
|
"method": "POST",
|
1628
|
-
"path": "/HAL-REL-PLACEHOLDER-PB-
|
1587
|
+
"path": "/HAL-REL-PLACEHOLDER-PB-PUBLISH-CONTRACTS",
|
1629
1588
|
"headers": {
|
1630
1589
|
"Content-Type": "application/json",
|
1631
1590
|
"Accept": "application/hal+json"
|
1632
1591
|
},
|
1633
1592
|
"body": {
|
1634
|
-
"
|
1635
|
-
|
1636
|
-
|
1637
|
-
|
1638
|
-
|
1639
|
-
|
1640
|
-
"
|
1641
|
-
|
1642
|
-
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
"path": "/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-Foo-5556b8149bf8bac76bc30f50a8a2dd4c22c85f30",
|
1653
|
-
"headers": {
|
1654
|
-
"Accept": "application/hal+json"
|
1655
|
-
}
|
1656
|
-
},
|
1657
|
-
"response": {
|
1658
|
-
"status": 404,
|
1659
|
-
"headers": {
|
1660
|
-
}
|
1661
|
-
}
|
1662
|
-
},
|
1663
|
-
{
|
1664
|
-
"description": "a request for a pacticipant version",
|
1665
|
-
"providerState": "version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with 2 environments that aren't test available for deployment",
|
1666
|
-
"request": {
|
1667
|
-
"method": "GET",
|
1668
|
-
"path": "/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-Foo-5556b8149bf8bac76bc30f50a8a2dd4c22c85f30",
|
1669
|
-
"headers": {
|
1670
|
-
"Accept": "application/hal+json"
|
1593
|
+
"pacticipantName": "Foo",
|
1594
|
+
"pacticipantVersionNumber": "5556b8149bf8bac76bc30f50a8a2dd4c22c85f30",
|
1595
|
+
"branch": "main",
|
1596
|
+
"tags": [
|
1597
|
+
"dev"
|
1598
|
+
],
|
1599
|
+
"buildUrl": "http://build",
|
1600
|
+
"contracts": [
|
1601
|
+
{
|
1602
|
+
"consumerName": "Foo",
|
1603
|
+
"providerName": "Bar",
|
1604
|
+
"specification": "pact",
|
1605
|
+
"contentType": "application/json",
|
1606
|
+
"content": "eyJjb25zdW1lciI6eyJuYW1lIjoiRm9vIn0sInByb3ZpZGVyIjp7Im5hbWUiOiJCYXIifSwiaW50ZXJhY3Rpb25zIjpbeyJkZXNjcmlwdGlvbiI6ImFuIGV4YW1wbGUgcmVxdWVzdCIsInByb3ZpZGVyU3RhdGUiOiJhIHByb3ZpZGVyIHN0YXRlIiwicmVxdWVzdCI6eyJtZXRob2QiOiJHRVQiLCJwYXRoIjoiLyIsImhlYWRlcnMiOnt9fSwicmVzcG9uc2UiOnsic3RhdHVzIjoyMDAsImhlYWRlcnMiOnsiQ29udGVudC1UeXBlIjoiYXBwbGljYXRpb24vaGFsK2pzb24ifX19XSwibWV0YWRhdGEiOnsicGFjdFNwZWNpZmljYXRpb24iOnsidmVyc2lvbiI6IjIuMC4wIn19fQ==",
|
1607
|
+
"writeMode": "overwrite",
|
1608
|
+
"onConflict": "overwrite"
|
1609
|
+
}
|
1610
|
+
]
|
1671
1611
|
}
|
1672
1612
|
},
|
1673
1613
|
"response": {
|
@@ -1676,56 +1616,42 @@
|
|
1676
1616
|
"Content-Type": "application/hal+json;charset=utf-8"
|
1677
1617
|
},
|
1678
1618
|
"body": {
|
1619
|
+
"_embedded": {
|
1620
|
+
"pacticipant": {
|
1621
|
+
"name": "Foo"
|
1622
|
+
},
|
1623
|
+
"version": {
|
1624
|
+
"number": "5556b8149bf8bac76bc30f50a8a2dd4c22c85f30",
|
1625
|
+
"buildUrl": "http://build"
|
1626
|
+
}
|
1627
|
+
},
|
1628
|
+
"logs": [
|
1629
|
+
{
|
1630
|
+
"level": "info",
|
1631
|
+
"message": "some message"
|
1632
|
+
}
|
1633
|
+
],
|
1679
1634
|
"_links": {
|
1680
|
-
"pb:
|
1635
|
+
"pb:pacticipant-version-tags": [
|
1681
1636
|
{
|
1682
|
-
"name": "
|
1683
|
-
|
1684
|
-
|
1637
|
+
"name": "dev"
|
1638
|
+
}
|
1639
|
+
],
|
1640
|
+
"pb:contracts": [
|
1685
1641
|
{
|
1686
|
-
"
|
1687
|
-
"href": "href"
|
1642
|
+
"href": "http://some-pact"
|
1688
1643
|
}
|
1689
1644
|
]
|
1690
1645
|
}
|
1691
1646
|
},
|
1692
1647
|
"matchingRules": {
|
1693
|
-
"$.body.
|
1694
|
-
"
|
1648
|
+
"$.body.logs": {
|
1649
|
+
"min": 1
|
1695
1650
|
},
|
1696
|
-
"$.body.
|
1651
|
+
"$.body.logs[*].*": {
|
1697
1652
|
"match": "type"
|
1698
|
-
}
|
1699
|
-
|
1700
|
-
}
|
1701
|
-
},
|
1702
|
-
{
|
1703
|
-
"description": "a request for the environments",
|
1704
|
-
"providerState": "an environment with name test exists",
|
1705
|
-
"request": {
|
1706
|
-
"method": "GET",
|
1707
|
-
"path": "/HAL-REL-PLACEHOLDER-PB-ENVIRONMENTS",
|
1708
|
-
"headers": {
|
1709
|
-
"Accept": "application/hal+json"
|
1710
|
-
}
|
1711
|
-
},
|
1712
|
-
"response": {
|
1713
|
-
"status": 200,
|
1714
|
-
"headers": {
|
1715
|
-
"Content-Type": "application/hal+json;charset=utf-8"
|
1716
|
-
},
|
1717
|
-
"body": {
|
1718
|
-
"_links": {
|
1719
|
-
"pb:environments": [
|
1720
|
-
{
|
1721
|
-
"name": "test",
|
1722
|
-
"href": "href"
|
1723
|
-
}
|
1724
|
-
]
|
1725
|
-
}
|
1726
|
-
},
|
1727
|
-
"matchingRules": {
|
1728
|
-
"$.body._links.pb:environments[0].href": {
|
1653
|
+
},
|
1654
|
+
"$.body._links.pb:contracts[0].href": {
|
1729
1655
|
"match": "type"
|
1730
1656
|
}
|
1731
1657
|
}
|