-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into snyk-fix-eb2db8b40f29216a80c489ed6479d911
- Loading branch information
Showing
20 changed files
with
259 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module Pact | ||
module ProviderVerifier | ||
VERSION = "1.38.2" | ||
VERSION = "1.39.0" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require 'json' | ||
|
||
describe "pact-provider-verifier with a provider state injected to a pact file" do | ||
before(:all) do | ||
@pipe = IO.popen("bundle exec rackup -p 5837 spec/support/provider_with_state_generator.rb") | ||
sleep 2 | ||
end | ||
|
||
subject { `bundle exec bin/pact-provider-verifier spec/support/pacts/pact-with-provider-state-in-headers.json -a 1 --provider-base-url http://localhost:5837/ --provider-states-setup-url http://localhost:5837/provider_state -v` } | ||
|
||
it "exits with a 0 exit code" do | ||
subject | ||
expect($?).to eq 0 | ||
end | ||
|
||
it "the output contains a success message" do | ||
expect(subject).to include "1 interaction, 0 failures" | ||
end | ||
|
||
after(:all) do | ||
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/ | ||
system("taskkill /im #{@pipe.pid} /f /t >nul 2>&1") | ||
else | ||
Process.kill 'KILL', @pipe.pid | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require 'json' | ||
|
||
describe "pact-provider-verifier with a provider state injected to a pact file" do | ||
before(:all) do | ||
@pipe = IO.popen("bundle exec rackup -p 5837 spec/support/provider_with_state_generator.rb") | ||
sleep 2 | ||
end | ||
|
||
subject { `bundle exec bin/pact-provider-verifier spec/support/pacts/pact-with-provider-state-in-path.json -a 1 --provider-base-url http://localhost:5837/ --provider-states-setup-url http://localhost:5837/provider_state -v` } | ||
|
||
it "exits with a 0 exit code" do | ||
subject | ||
expect($?).to eq 0 | ||
end | ||
|
||
it "the output contains a success message" do | ||
expect(subject).to include "1 interaction, 0 failures" | ||
end | ||
|
||
after(:all) do | ||
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/ | ||
system("taskkill /im #{@pipe.pid} /f /t >nul 2>&1") | ||
else | ||
Process.kill 'KILL', @pipe.pid | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
require 'pact/provider_verifier/aggregate_pact_configs' | ||
require 'ostruct' | ||
|
||
module Pact | ||
module ProviderVerifier | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
spec/support/pacts/pact-with-provider-state-in-headers.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"provider": { | ||
"name": "Foo" | ||
}, | ||
"consumer": { | ||
"name": "Bar" | ||
}, | ||
"interactions": [ | ||
{ | ||
"description": "requires access token", | ||
"request": { | ||
"method": "GET", | ||
"path": "/requires_auth", | ||
"headers": { | ||
"Authorization": "Bearer EXAMPLE_TOKEN" | ||
}, | ||
"generators": { | ||
"header": { | ||
"$.Authorization": { | ||
"expression": "Bearer ${accessToken}", | ||
"type": "ProviderState" | ||
} | ||
} | ||
} | ||
}, | ||
"response": { | ||
"status": 200 | ||
}, | ||
"providerStates": [ | ||
{ | ||
"name": "returns access token" | ||
} | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"pactSpecification": { | ||
"version": "3.0.0" | ||
}, | ||
"pact-jvm": { | ||
"version": "4.0.5" | ||
} | ||
} | ||
} |
Oops, something went wrong.