Skip to content

Commit 5a324ab

Browse files
committed
Squashed 'compatibility-suite/pact-compatibility-suite/' changes from 4db89a19c..bd6b2044c
bd6b2044c feat: Add V4 message scenarios git-subtree-dir: compatibility-suite/pact-compatibility-suite git-subtree-split: bd6b2044c205cf10e47bb386e384d9283faae325
1 parent 8c9c03a commit 5a324ab

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

features/V4/message_consumer.feature

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@consumer @message
2+
Feature: Message consumer
3+
Supports V4 async message consumer interactions
4+
5+
Scenario: Sets the type for the interaction
6+
Given a message interaction is being defined for a consumer test
7+
When the Pact file for the test is generated
8+
Then the first interaction in the Pact file will have a type of "Asynchronous/Messages"
9+
10+
Scenario: Supports specifying a key for the interaction
11+
Given a message interaction is being defined for a consumer test
12+
And a key of "123ABC" is specified for the message interaction
13+
When the Pact file for the test is generated
14+
Then the first interaction in the Pact file will have "key" = '"123ABC"'
15+
16+
Scenario: Supports specifying the interaction is pending
17+
Given a message interaction is being defined for a consumer test
18+
And the message interaction is marked as pending
19+
When the Pact file for the test is generated
20+
Then the first interaction in the Pact file will have "pending" = 'true'
21+
22+
Scenario: Supports adding comments
23+
Given a message interaction is being defined for a consumer test
24+
And a comment "this is a comment" is added to the message interaction
25+
When the Pact file for the test is generated
26+
Then the first interaction in the Pact file will have "comments" = '{"text":["this is a comment"]}'

features/V4/message_provider.feature

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@provider @message
2+
Feature: Message provider
3+
Supports verifying a async message provider using V4 features
4+
5+
Scenario: Verifying a pending message interaction
6+
Given a provider is started that can generate the "basic" message with "file: basic2.json"
7+
And a Pact file for "basic":"file: basic.json" is to be verified, but is marked pending
8+
When the verification is run
9+
Then the verification will be successful
10+
And there will be a pending "Body had differences" error
11+
12+
Scenario: Verifying a message interaction with comments
13+
Given a provider is started that can generate the "basic" message with "file: basic.json"
14+
And a Pact file for "basic":"file: basic.json" is to be verified with the following comments:
15+
| comment | type |
16+
| comment one | text |
17+
| comment two | text |
18+
| compatibility-suite | testname |
19+
When the verification is run
20+
Then the comment "comment one" will have been printed to the console
21+
And the comment "comment two" will have been printed to the console
22+
And the "compatibility-suite" will displayed as the original test name

features/V4/v4.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ Feature: General V4 features
55
Given an HTTP interaction is being defined for a consumer test
66
And a message interaction is being defined for a consumer test
77
When the Pact file for the test is generated
8-
Then the first interaction in the Pact file will have a type of "Synchronous/HTTP"
9-
Then the second interaction in the Pact file will have a type of "Asynchronous/Messages"
8+
Then there will be an interaction in the Pact file with a type of "Synchronous/HTTP"
9+
And there will be an interaction in the Pact file with a type of "Asynchronous/Messages"

0 commit comments

Comments
 (0)