pact_broker-client 1.75.3 → 1.75.4

Sign up to get free protection for your applications and to get access to all the features.
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,28 +0,0 @@
1
- -----BEGIN PRIVATE KEY-----
2
- MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCvUIWtjnXha0gl
3
- KomEVAZ4DS5/D0Rg2ij1po3ft1jliTTNUTYBXxqSmJ8WCaeCenlu2nkOqPeEPkDm
4
- afmMZurYa7b40W3BGnwKK3uBMAuLY176BaMvpisM5p45ScPoWt07DAKg9xhgyxe7
5
- g55pYlEUaPEzpifvjMLLPVIW+afSwK41l2t7FfHWvoLMT9mk4AWX851ITSgxlH3s
6
- 2GuVBGx0POvawNTwKi97TgtjOS019PAtj5c8yzheU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Ux8K7sU2whZvLEUM+mO+jWOe3USHjR3aXYnU
12
- OjNhN90/TAy5wlIK6U2C36nHyZJUeScxuiaVwErwayE+GgwYmw9R7HVofgcVfTve
13
- IpjyrT7mDOCMYjkHgZv1dSHQTcc6uclaw7SgywEEjxjCNSJCN+WPjxCdcuno0td8
14
- i7F6FL7FeOiP1mtQrTo42Tq+knerUc55CbTW4anbQfL+6TFEVCPJKduLHFieGB0k
15
- BFilUR3JD2t8/f4fIilQ6FrMZpUzKcLbgW9cjts8mxq0zNV+z6lISgKbdxZFQp+2
16
- fvyYdnoNLP0YeRI6j9x1pg==
17
- -----END CERTIFICATE-----
@@ -1,28 +0,0 @@
1
- -----BEGIN PRIVATE KEY-----
2
- MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCY+gxfm7tA4V5p
3
- AWgtvgpKKjZbDvi81vW2ZzQkJNCcPfX4Ahky4n1NzXsgISoB7Pldxv/VC2zK8WDE
4
- kP6bK616UuxTPcbQNFmdFQIOzouFhIvsLnhNEdRpjjTLglU9iQmHebg4fPpq1qFa
5
- m/S+MSLMtJGldDZ5fjV9cw7x11B836N0966GsUW3ejfdqjT864/E74sG2qU9G6OB
6
- isEwjjtXsDxRgo7FhHi2eKdlH2zs1v84yARFA/CqoBTobePMvSelxt02+tf+53k9
7
- MY+hO3J+oRks7oiDP6GW7blLe9lQ4Gy2zq0tNqB082JgvbVS9+UL34M66sNAxL+8
8
- 6Zv94htLAgMBAAECggEAF2l9Z0yANgfH2S478XQ6Qut+8iSycMQ9SrM0yatQufjJ
9
- ojFABgefwb6G733j3fOUnoOMN+DNv6l9c9f0/26J2ETEomC8ArVgWagTboyx0bdd
10
- asIZ60GlTppS/ipuPUKx0KgSR6Lo+FzsyN9Bb7I5bzbba4UDqUhli1OGoACh8tpS
11
- pyhD58C0nWBCYUjgkB2ilVoguQnnTvYC0VDbGOWK1P8bw0to810mkKTyv7ztifW2
12
- lHUwTe8vbQk7jY52+crvtgVZW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DXd3cgLgmXQTYHIijWXPlF
18
- /WXWmZXK0E9fiDjfXI9eB7E237fYGOaSobOhLOLoHcuL0kndps67QP2BhtXhYB88
19
- 1We7LoJVUwKBgQCnF1qtH5d0ukPTEdC73Q0z/buM7tPKRMTqXHxxPQN9782tVDYf
20
- nAlWiVTENqpoUM4fxKq/SSL+SvfhyvrMW/z8NLi2bDUpEzviufg58N+v60dOeFyC
21
- hgiSLgYGUfweeGrPx6qymGxo7SCWSLtrjhqZB/UIAADnTAeTcOKGhECQHQKBgAlM
22
- A29J+BuBZMzK87CJIjbeRaVrmvSjXdeMzd+o+01ratn9bjwO14SRTfvhlbRzLLLO
23
- y78YmutZbuZuWY5p5pUjJ9uv2o/INr3vnV0NqM4yVx8Vr/YoOnCkHGAKf4iVs8bw
24
- E/b/8RHmOOvgSjjbvIKY8E1jMH8Az2e0CfqYyOBdAoGAOlhTefyBGgAWFHqH/l4p
25
- ThbWupIMsw1ZXlArwBnTfsUFuz0Yq7B+0tqrV8lhS3P4/0jI2yWnzhluDk62clwz
26
- Xg187V85Ylagshsjv60mP5qBEF4N7Nf5fP2w6+GjMU+YiHEBsgGGt+2jPgKeCGQW
27
- IlV3ym59oL+wGyN9OK3z+aw=
28
- -----END PRIVATE KEY-----
@@ -1,31 +0,0 @@
1
- {
2
- "consumer": {
3
- "name": "Foo"
4
- },
5
- "provider": {
6
- "name": "Bar"
7
- },
8
- "interactions": [
9
- {
10
- "description": "an example request",
11
- "providerState": "a provider state",
12
- "request": {
13
- "method": "GET",
14
- "path": "/",
15
- "headers": {
16
- }
17
- },
18
- "response": {
19
- "status": 200,
20
- "headers": {
21
- "Content-Type": "application/hal+json"
22
- }
23
- }
24
- }
25
- ],
26
- "metadata": {
27
- "pactSpecification": {
28
- "version": "2.0.0"
29
- }
30
- }
31
- }
@@ -1,24 +0,0 @@
1
- describe "pact-broker can-i-deploy", skip_windows: true do
2
- before(:all) do
3
- @pipe = IO.popen("bundle exec pact-stub-service spec/pacts/pact_broker_client-pact_broker.json -p 5000 --log tmp/pact-stub-can-i-deploy.log")
4
- sleep 4
5
- end
6
-
7
- context "when the pacticipants can be deployed" do
8
- subject { `bundle exec bin/pact-broker can-i-deploy --pacticipant Foo --version 1.2.3 --pacticipant Bar --version 4.5.6 --broker-base-url http://localhost:5000` }
9
-
10
- it "returns a success exit code" do
11
- subject
12
- puts subject unless $?.exitstatus == 0
13
- expect($?.exitstatus).to eq 0
14
- expect(subject).to match /CONSUMER/
15
- expect(subject).to match /Foo/
16
- expect(subject).to match /PROVIDER/
17
- expect(subject).to match /Bar/
18
- end
19
- end
20
-
21
- after(:all) do
22
- Process.kill 'KILL', @pipe.pid
23
- end
24
- end
@@ -1,44 +0,0 @@
1
- require "pact_broker/client/cli/broker"
2
- require 'ostruct'
3
-
4
- module PactBroker
5
- module Client
6
- module CLI
7
- describe Broker do
8
- before do
9
- subject.options = OpenStruct.new(minimum_valid_options)
10
- allow($stdout).to receive(:puts)
11
- allow($stderr).to receive(:puts)
12
- allow(Retry).to receive(:sleep)
13
-
14
- stub_const("ARGV", %w[--pacticipant Foo --version 1])
15
- stub_request(:get, "http://pact-broker/matrix?latest=true&latestby=cvp&mainBranch=true&q%5B%5D%5Bpacticipant%5D=Foo&q%5B%5D%5Bversion%5D=1").
16
- with(
17
- headers: {
18
- 'Accept'=>'application/hal+json',
19
- }).
20
- to_return(status: 200, body: File.read("spec/support/matrix.json"), headers: { "Content-Type" => "application/hal+json" })
21
- end
22
-
23
- let(:minimum_valid_options) do
24
- {
25
- broker_base_url: 'http://pact-broker',
26
- output: 'table',
27
- verbose: 'verbose',
28
- retry_while_unknown: 1,
29
- retry_interval: 2,
30
- limit: 1000,
31
- dry_run: false
32
- }
33
- end
34
-
35
- let(:invoke_can_i_merge) { subject.can_i_merge }
36
-
37
- it "sends a matrix query" do
38
- expect($stdout).to receive(:puts).with(/Computer says yes/)
39
- invoke_can_i_merge
40
- end
41
- end
42
- end
43
- end
44
- end
@@ -1,20 +0,0 @@
1
- describe "pact-broker create-version-tag", skip_windows: true do
2
- before(:all) do
3
- @pipe = IO.popen("bundle exec pact-stub-service spec/pacts/pact_broker_client-pact_broker.json -p 5001 --log tmp/pact-stub-service-create-verison-tag.log")
4
- sleep 2
5
- end
6
-
7
- context "when the version is successfully tagged" do
8
- subject { `bundle exec bin/pact-broker create-version-tag --auto-create-version --pacticipant Condor --version 1.3.0 --tag prod --broker-base-url http://localhost:5001` }
9
-
10
- it "returns a success exit code" do
11
- subject
12
- expect($?.exitstatus).to eq 0
13
- expect(subject).to include 'Tagging Condor version 1.3.0 as prod'
14
- end
15
- end
16
-
17
- after(:all) do
18
- Process.kill 'KILL', @pipe.pid
19
- end
20
- end
@@ -1,31 +0,0 @@
1
- require 'pact_broker/client/cli/broker'
2
-
3
- RSpec.describe "describe-environment" do
4
- let(:index_body_hash) do
5
- {
6
- _links: {
7
- "pb:pacticipant" => {
8
- href: "http://broker/pacticipants/{pacticipant}"
9
- }
10
- }
11
- }
12
- end
13
-
14
- let(:pacticipant_body_hash) { JSON.parse(File.read("./spec/support/pacticipant_get.json")) }
15
-
16
- let!(:index_request) do
17
- stub_request(:get, "http://broker").to_return(status: 200, body: index_body_hash.to_json, headers: { "Content-Type" => "application/hal+json" } )
18
- end
19
-
20
- let!(:pacticipant_request) do
21
- stub_request(:get, "http://broker/pacticipants/Foo").to_return(status: 200, body: pacticipant_body_hash.to_json, headers: { "Content-Type" => "application/hal+json" } )
22
- end
23
-
24
- let(:parameters) { %w{describe-pacticipant --name Foo --broker-base-url http://broker} }
25
-
26
- subject { capture(:stdout) { PactBroker::Client::CLI::Broker.start(parameters) } }
27
-
28
- it "prints the pacticipant properties" do
29
- Approvals.verify(subject, :name => "describe_pacticipant", format: :txt)
30
- end
31
- end
@@ -1,53 +0,0 @@
1
- require "pactflow/client/cli/pactflow"
2
-
3
- RSpec.describe "publish-provider-contract" do
4
- let(:index_body_hash) do
5
- {
6
- _links: {
7
- "pf:publish-provider-contract" => {
8
- href: "http://broker/some-publish/{provider}"
9
- }
10
- }
11
- }
12
- end
13
-
14
- let(:post_response_body) do
15
- {
16
- "notices"=>[{"text"=>"some notice", "type"=>"info"}, {"text"=>"some other notice", "type"=>"info"}]
17
- }
18
- end
19
-
20
- let!(:index_request) do
21
- stub_request(:get, "http://broker").to_return(status: 200, body: index_body_hash.to_json, headers: { "Content-Type" => "application/hal+json" } )
22
- end
23
-
24
- let!(:publish_request) do
25
- stub_request(:post, "http://broker/some-publish/Bar").to_return(status: 200, body: post_response_body.to_json, headers: { "Content-Type" => "application/hal+json" } )
26
- end
27
-
28
- let(:parameters) do
29
- %w{
30
- publish-provider-contract
31
- script/oas.yml
32
- --provider Bar
33
- --broker-base-url http://broker
34
- --provider-app-version 1013b5650d61214e19f10558f97fb5a3bb082d44
35
- --branch main
36
- --tag dev
37
- --specification oas
38
- --content-type application/yml
39
- --verification-exit-code 0
40
- --verification-results script/verification-results.txt
41
- --verification-results-content-type text/plain
42
- --verification-results-format text
43
- --verifier my-custom-tool
44
- --verifier-version "1.0"
45
- }
46
- end
47
-
48
- subject { capture(:stdout) { Pactflow::Client::CLI::Pactflow.start(parameters) } }
49
-
50
- it "prints the notices" do
51
- Approvals.verify(subject, :name => "publish_provider_contract", format: :txt)
52
- end
53
- end
@@ -1,39 +0,0 @@
1
- require "open3"
2
- require "pact_broker/client/cli/broker"
3
-
4
- # This is not the ideal way to write a test, but I tried to write it with an in memory invocation,
5
- # and I couldn't get the capture to work, and it became super complicated.
6
-
7
- RSpec.describe "using unknown options", skip_windows: true do
8
- let(:unknown_switches_text) { "Unknown switches" }
9
- let(:warning_text) { "This is a warning"}
10
- let(:command) { "bundle exec bin/pact-broker can-i-deploy --pacticipant Foo --foo --broker-base-url http://example.org" }
11
-
12
- it "prints an 'unknown switches' warning to stderr and also includes the normal output of the command" do
13
- stderr_lines = nil
14
-
15
- Open3.popen3(command) do |stdin, stdout, stderr, thread|
16
- stderr_lines = stderr.readlines
17
- end
18
-
19
- expect(stderr_lines.join("\n")).to include(unknown_switches_text)
20
- expect(stderr_lines.join("\n")).to include(warning_text)
21
-
22
- expect(stderr_lines.size).to be > 2
23
- end
24
-
25
-
26
- context "with PACT_BROKER_ERROR_ON_UNKNOWN_OPTION=true" do
27
- it "prints an 'unknown switches' message to stderr and does NOT include the normal output of the command as it exits straight after" do
28
- stderr_lines = nil
29
-
30
- Open3.popen3({ "PACT_BROKER_ERROR_ON_UNKNOWN_OPTION" => "true" }, command) do |stdin, stdout, stderr, thread|
31
- stderr_lines = stderr.readlines
32
- end
33
-
34
- expect(stderr_lines.first).to include(unknown_switches_text)
35
- expect(stderr_lines.join("\n")).to_not include(warning_text)
36
- expect(stderr_lines.size).to eq 1
37
- end
38
- end
39
- end
@@ -1,182 +0,0 @@
1
- require 'pact_broker/client/base_client'
2
- module PactBroker
3
- module Client
4
- describe BaseClient do
5
- subject { BaseClient.new(base_url: base_url) }
6
-
7
- let(:base_url) { 'http://pact_broker_base_url'}
8
-
9
- describe '#initialize' do
10
- let(:username) { 'pact_repo_username'}
11
- let(:password) { 'pact_repo_password'}
12
- let(:token) { '123456789' }
13
- let(:client_options) do
14
- {
15
- basic_auth: {
16
- username: username,
17
- password: password
18
- },
19
- token: token
20
- }
21
- end
22
-
23
- context 'with basic url' do
24
- it 'sets the base url' do
25
- base_client = BaseClient.new(base_url: base_url)
26
- expect(base_client.base_url).to eq(base_url)
27
- expect(BaseClient.base_uri).to eq(base_url)
28
- end
29
- end
30
-
31
- context 'with client options' do
32
- subject { BaseClient.new(base_url: base_url, client_options: client_options) }
33
- it 'sets the client options' do
34
- expect(subject.client_options).to eq(client_options)
35
- end
36
-
37
- context 'when client options contains basic auth' do
38
- it 'sets the httpparty basic auth' do
39
- expect(BaseClient).to receive(:basic_auth).with(username, password)
40
- subject
41
- end
42
- end
43
-
44
- context 'when client options contains broker token' do
45
- it 'sets the httparty broker token' do
46
- expect(BaseClient).to receive(:headers).with('Authorization' => "Bearer #{token}")
47
- subject
48
- end
49
- end
50
- end
51
-
52
- context 'without client options' do
53
- subject { BaseClient.new(base_url: base_url) }
54
- it 'set the client options to empty hash ' do
55
- expect(subject.client_options).to eq({})
56
- end
57
-
58
- it 'does not set the httpparty basic auth' do
59
- expect(BaseClient).to_not receive(:basic_auth).with(username, password)
60
- subject
61
- end
62
-
63
- it 'does not set the httparty broker token' do
64
- expect(BaseClient).to_not receive(:headers).with('Authorization' => "Bearer #{token}")
65
- subject
66
- end
67
- end
68
-
69
- context 'when the SSL_CERT_FILE environment variable is set' do
70
- before do
71
- allow(ENV).to receive(:[]).and_call_original
72
- allow(ENV).to receive(:[]).with('SSL_CERT_FILE').and_return('ssl_cert_file')
73
- end
74
-
75
- subject { BaseClient.new(base_url: base_url) }
76
-
77
- it 'sets the ssl_ca_file' do
78
- expect(BaseClient).to receive(:ssl_ca_file).with('ssl_cert_file')
79
- subject
80
- end
81
- end
82
-
83
- context 'when the SSL_CERT_DIR environment variable is set' do
84
- before do
85
- allow(ENV).to receive(:[]).and_call_original
86
- allow(ENV).to receive(:[]).with('SSL_CERT_DIR').and_return('ssl_cert_dir')
87
- end
88
-
89
- subject { BaseClient.new(base_url: base_url) }
90
-
91
- it 'sets the ssl_ca_file' do
92
- expect(BaseClient).to receive(:ssl_ca_path).with('ssl_cert_dir')
93
- subject
94
- end
95
- end
96
-
97
- describe "url_for_relation" do
98
- let(:index_body) do
99
- {
100
- _links: {
101
- :'pb:foo-bar' => {
102
- href: "http://foo-bar/{name}"
103
- }
104
- }
105
- }.to_json
106
- end
107
-
108
- let!(:request) do
109
- stub_request(:get, "http://pact_broker_base_url/").to_return(status: 200, body: index_body, headers: { "Content-Type" => "application/json" } )
110
- end
111
-
112
- it "retrieves a relation URL from the index" do
113
- expect(subject.url_for_relation('pb:foo-bar', name: 'wiffle')).to eq 'http://foo-bar/wiffle'
114
- end
115
-
116
- context "when the relation is not found" do
117
- it "raises an error" do
118
- expect { subject.url_for_relation('pb:not-found', name: 'wiffle') }.to raise_error PactBroker::Client::RelationNotFound, /Could not find relation pb:not-found in index resource/
119
- end
120
- end
121
- end
122
- end
123
-
124
- describe '#handle_response' do
125
- let(:response) { double('Response', success?: true) }
126
-
127
- it 'yields response object' do
128
- expect { |block| subject.handle_response(response, &block) }.to yield_with_args(response)
129
- end
130
-
131
- context 'with 404 response' do
132
- let(:response) { double('Response', success?: false, code: 404) }
133
- it 'returns nil' do
134
- expect(subject.handle_response(response)).to be_nil
135
- end
136
- end
137
-
138
- context 'with 401 response' do
139
- let(:response) { double('Response', success?: false, code: 401, body: 'body') }
140
- it 'raise an exception with meaningful message' do
141
- expect { subject.handle_response(response) }
142
- .to raise_error(PactBroker::Client::Error, "Authentication failed: body")
143
- end
144
- end
145
-
146
- context 'with 403 response' do
147
- let(:response) { double('Response', success?: false, code: 403, body: 'body') }
148
- it 'raise an exception with meaningful message' do
149
- expect { subject.handle_response(response) }
150
- .to raise_error(PactBroker::Client::Error, "Authorization failed (insufficient permissions): body")
151
- end
152
- end
153
-
154
- context 'with 409 response' do
155
- let(:response) { double('Response', success?: false, code: 409, body: 'body') }
156
- it 'raise an exception with meaningful message' do
157
- expect { subject.handle_response(response) }
158
- .to raise_error(PactBroker::Client::Error, "Potential duplicate pacticipants: body")
159
- end
160
- end
161
-
162
- context 'with unsuccessful JSON response' do
163
- let(:response) do
164
- double('Response', success?: false, code: 500, body: '{"errors": ["Internal server error"]}')
165
- end
166
- it 'raise an exception with meaningful message' do
167
- expect { subject.handle_response(response) }
168
- .to raise_error(PactBroker::Client::Error, "Internal server error")
169
- end
170
- end
171
-
172
- context 'with unsucessful nono-JSON response ' do
173
- let(:response) { double('Response', success?: false, code: 500, body: 'Internal server error') }
174
- it 'raise an exception with meaningful message' do
175
- expect { subject.handle_response(response) }
176
- .to raise_error(PactBroker::Client::Error, "status=500 Internal server error")
177
- end
178
- end
179
- end
180
- end
181
- end
182
- end