pact-provider-verifier 1.19.0 → 1.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/Gemfile +1 -1
- data/README.md +5 -1
- data/lib/pact/provider_verifier/set_up_provider_state.rb +8 -2
- data/lib/pact/provider_verifier/version.rb +1 -1
- metadata +6 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4d877e456eddfe42cc7b33ca0bd242cc9d25f15a859ba799b72be0383a24064
|
4
|
+
data.tar.gz: b96350334233dd8fc1164c18482890ce7e0644a3c462c91350dcdabafd3b4047
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f70528ae38442f641089226d03ec100802e3f9f77adabcefb2687e017f2405c4c745d105c6e8d82db5d741c4071a7980a42a24b7eea05e855254c71e6dcbb811
|
7
|
+
data.tar.gz: 6af6026d002d9a0c10ad63906a13828bbcf6fe70c3d94b21a163a453a7d05aea02ff37ea1b2c4f7f08dd114ddc5a3dcfb42bbb015b22893f88d4cf68a735dd9d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
<a name="v1.20.0-1"></a>
|
2
|
+
### v1.20.0-1 (2018-10-04)
|
3
|
+
|
4
|
+
|
5
|
+
#### Features
|
6
|
+
|
7
|
+
* **pact specification v3**
|
8
|
+
* add support for multiple provider states and params ([556b957](/../../commit/556b957))
|
9
|
+
|
10
|
+
|
1
11
|
<a name="v1.18.0-1"></a>
|
2
12
|
### v1.18.0-1 (2018-09-11)
|
3
13
|
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -127,7 +127,11 @@ Rather than tearing down the specific test data created after each interaction,
|
|
127
127
|
|
128
128
|
Note that the HTTP endpoint does not have to actually be within your application - it just has to have access to the same data store. So if you cannot add "test only" endpoints during your verification, consider making a separate app which shares credentials to your app's datastore. It is highly recommended that you run your verifications against a locally running provider, rather than a deployed one, as this will make it much easier to stub any downstream calls, debug issues, and it will make your tests run as fast as possible.
|
129
129
|
|
130
|
-
Ignore the `states` array that you will see if you happen to print out the live provider state set up request body - that was an attempt to make the set up call forwards compatible with the v3 pact specification, which allows multiple provider states. Unfortunately, this forwards compatibilty attempt failed, because the v3 provider states support a map of params, not just a name, so it should have been `{ "state": { "name": "PROVIDER_STATE, "params": {...} } }`.
|
130
|
+
Ignore the `states` array that you will see if you happen to print out the live provider state set up request body - that was an attempt to make the set up call forwards compatible with the v3 pact specification, which allows multiple provider states. Unfortunately, this forwards compatibilty attempt failed, because the v3 provider states support a map of params, not just a name, so it should have been `{ "state": { "name": "PROVIDER_STATE, "params": {...} } }`. See the next section for the actual v3 support.
|
131
|
+
|
132
|
+
#### Pact specification v3 provider state support
|
133
|
+
|
134
|
+
The v3 Pact specification adds support for multiple provider states, and provider state params. If you are verifying a pact with multiple provider states, then set up URL will be invoked once for each state. The `params` hash from the pact will also be passed through in the JSON document with the key name `params`.
|
131
135
|
|
132
136
|
### Using the Pact Broker with Basic authentication
|
133
137
|
|
@@ -11,6 +11,7 @@ module Pact
|
|
11
11
|
@provider_state = provider_state
|
12
12
|
@consumer = consumer
|
13
13
|
@options = options
|
14
|
+
@params = (options && options[:params]) || {}
|
14
15
|
end
|
15
16
|
|
16
17
|
def self.call provider_state, consumer, options
|
@@ -30,7 +31,7 @@ module Pact
|
|
30
31
|
|
31
32
|
private
|
32
33
|
|
33
|
-
attr_reader :provider_state, :consumer
|
34
|
+
attr_reader :provider_state, :consumer, :params
|
34
35
|
|
35
36
|
def post_to_provider_state
|
36
37
|
verbose = verbose?
|
@@ -59,7 +60,12 @@ module Pact
|
|
59
60
|
connection.post do |req|
|
60
61
|
req.headers["Content-Type"] = "application/json"
|
61
62
|
add_custom_provider_header req
|
62
|
-
req.body = {
|
63
|
+
req.body = {
|
64
|
+
consumer: consumer,
|
65
|
+
state: provider_state,
|
66
|
+
states: [provider_state],
|
67
|
+
params: params
|
68
|
+
}.to_json
|
63
69
|
end
|
64
70
|
end
|
65
71
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact-provider-verifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Fellows
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-10-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -31,34 +31,28 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '1.
|
34
|
+
version: '1.36'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '1.
|
41
|
+
version: '1.36'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: pact-message
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '0.
|
49
|
-
- - ">="
|
50
|
-
- !ruby/object:Gem::Version
|
51
|
-
version: 0.4.1
|
48
|
+
version: '0.5'
|
52
49
|
type: :runtime
|
53
50
|
prerelease: false
|
54
51
|
version_requirements: !ruby/object:Gem::Requirement
|
55
52
|
requirements:
|
56
53
|
- - "~>"
|
57
54
|
- !ruby/object:Gem::Version
|
58
|
-
version: '0.
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 0.4.1
|
55
|
+
version: '0.5'
|
62
56
|
- !ruby/object:Gem::Dependency
|
63
57
|
name: faraday
|
64
58
|
requirement: !ruby/object:Gem::Requirement
|