pact_broker-client 1.48.0 → 1.51.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,20 +0,0 @@
1
- echo '### publish'
2
- echo ''
3
- echo '```'
4
- echo "$(bundle exec bin/pact-broker help publish)"
5
- echo '```'
6
- echo ''
7
- echo '### create-version-tag'
8
- echo ''
9
- echo '```'
10
- echo "$(bundle exec bin/pact-broker help create-version-tag)"
11
- echo '```'
12
- echo ''
13
- echo '### can-i-deploy'
14
- echo ''
15
- echo '*This feature is in beta release, and backwards compatibility is NOT guaranteed.*'
16
- echo 'You will need the latest version of the Pact Broker for this feature to work.'
17
- echo ''
18
- echo '```'
19
- echo "$(bundle exec bin/pact-broker help can-i-deploy)"
20
- echo '```'
@@ -1,89 +0,0 @@
1
- require_relative 'pact_helper'
2
- require 'pact_broker/client'
3
- require 'pact_broker/client/publish_pacts_the_old_way'
4
-
5
- describe PactBroker::Client::Versions, pact: true do
6
-
7
- include_context "pact broker"
8
-
9
-
10
- describe "creating a pacticipant version" do
11
- before do
12
- allow(publish_pacts_the_old_way).to receive(:consumer_names).and_return(["Foo"])
13
- allow($stdout).to receive(:puts)
14
- end
15
- let(:version_path) { "/HAL-REL-PLACEHOLDER-INDEX-PB-PACTICIPANT-VERSION-{pacticipant}-{version}" }
16
- let(:version_url) { pact_broker.mock_service_base_url + version_path }
17
- let(:number) { "26f353580936ad3b9baddb17b00e84f33c69e7cb" }
18
- let(:branch) { "main" }
19
- let(:build_url) { "http://my-ci/builds/1" }
20
- let(:consumer_version_params) { { number: number, branch: branch, build_url: build_url } }
21
- let(:publish_pacts_the_old_way) { PactBroker::Client::PublishPactsTheOldWay.new(pact_broker.mock_service_base_url, ["some-pact.json"], consumer_version_params, {}) }
22
- let(:provider_state) { "version #{number} of pacticipant Foo does not exist" }
23
- let(:expected_response_status) { 201 }
24
-
25
- subject { publish_pacts_the_old_way.send(:create_consumer_versions) }
26
-
27
- before do
28
- pact_broker
29
- .given("the pb:pacticipant-version relation exists in the index resource")
30
- .upon_receiving("a request for the index resource")
31
- .with(
32
- method: :get,
33
- path: '/',
34
- headers: get_request_headers).
35
- will_respond_with(
36
- status: 200,
37
- headers: pact_broker_response_headers,
38
- body: {
39
- _links: {
40
- :'pb:pacticipant-version' => {
41
- href: Pact.term(version_url, /http:\/\/.*{pacticipant}.*{version}/)
42
- }
43
- }
44
- }
45
- )
46
-
47
- pact_broker
48
- .given(provider_state)
49
- .upon_receiving("a request to create a pacticipant version")
50
- .with(
51
- method: :put,
52
- path: "/HAL-REL-PLACEHOLDER-INDEX-PB-PACTICIPANT-VERSION-Foo-#{number}",
53
- headers: put_request_headers,
54
- body: {
55
- branch: branch,
56
- buildUrl: build_url
57
- }).
58
- will_respond_with(
59
- status: expected_response_status,
60
- headers: pact_broker_response_headers,
61
- body: {
62
- number: number,
63
- branch: branch,
64
- buildUrl: build_url,
65
- _links: {
66
- self: {
67
- href: Pact.term('http://localhost:1234/some-url', %r{http://.*})
68
- }
69
- }
70
- }
71
- )
72
- end
73
-
74
- context "when the version does not already exist" do
75
- it "returns true" do
76
- expect(subject).to be true
77
- end
78
- end
79
-
80
- context "when the version does exist" do
81
- let(:provider_state) { "version #{number} of pacticipant Foo does exist" }
82
- let(:expected_response_status) { 200 }
83
-
84
- it "returns true" do
85
- expect(subject).to be true
86
- end
87
- end
88
- end
89
- end