-
-
Notifications
You must be signed in to change notification settings - Fork 480
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit 'eef31107a3c55d1fd33e7e1b916aa6fb131693ec'
- Loading branch information
Showing
13 changed files
with
447 additions
and
18 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
47 changes: 47 additions & 0 deletions
47
compatibility-suite/pact-compatibility-suite/features/V4/generators.feature
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,47 @@ | ||
Feature: V4 era Generators | ||
|
||
Scenario: Supports a Provider State generator | ||
Given a request configured with the following generators: | ||
| body | generators | | ||
| file: basic.json | providerstate-generator.json | | ||
And the generator test mode is set as "Provider" | ||
When the request is prepared for use with a "providerState" context: | ||
| { "id": 1000 } | | ||
Then the body value for "$.one" will have been replaced with "1000" | ||
|
||
Scenario: Supports a Mock server URL generator | ||
Given a request configured with the following generators: | ||
| body | generators | | ||
| file: basic.json | mockserver-generator.json | | ||
And the generator test mode is set as "Consumer" | ||
When the request is prepared for use with a "mockServer" context: | ||
| { "href": "http://somewhere.world" } | | ||
Then the body value for "$.one" will have been replaced with "http://somewhere.world/a" | ||
|
||
Scenario: Supports a simple UUID generator | ||
Given a request configured with the following generators: | ||
| body | generators | | ||
| file: basic.json | uuid-generator-simple.json | | ||
When the request is prepared for use | ||
Then the body value for "$.one" will have been replaced with a "simple UUID" | ||
|
||
Scenario: Supports a lower-case-hyphenated UUID generator | ||
Given a request configured with the following generators: | ||
| body | generators | | ||
| file: basic.json | uuid-generator-lower-case-hyphenated.json | | ||
When the request is prepared for use | ||
Then the body value for "$.one" will have been replaced with a "lower-case-hyphenated UUID" | ||
|
||
Scenario: Supports a upper-case-hyphenated UUID generator | ||
Given a request configured with the following generators: | ||
| body | generators | | ||
| file: basic.json | uuid-generator-upper-case-hyphenated.json | | ||
When the request is prepared for use | ||
Then the body value for "$.one" will have been replaced with a "upper-case-hyphenated UUID" | ||
|
||
Scenario: Supports a URN UUID generator | ||
Given a request configured with the following generators: | ||
| body | generators | | ||
| file: basic.json | uuid-generator-urn.json | | ||
When the request is prepared for use | ||
Then the body value for "$.one" will have been replaced with a "URN UUID" |
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
78 changes: 78 additions & 0 deletions
78
compatibility-suite/pact-compatibility-suite/fixtures/arraycontains-matcher-v4.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,78 @@ | ||
{ | ||
"body": { | ||
"$.actions": { | ||
"combine": "AND", | ||
"matchers": [ | ||
{ | ||
"match": "arrayContains", | ||
"variants": [ | ||
{ | ||
"generators": {}, | ||
"index": 0, | ||
"rules": { | ||
"$.name": { | ||
"combine": "AND", | ||
"matchers": [ | ||
{ | ||
"match": "regex", | ||
"regex": "add\\-item" | ||
} | ||
] | ||
}, | ||
"$.method": { | ||
"combine": "AND", | ||
"matchers": [ | ||
{ | ||
"match": "regex", | ||
"regex": "POST" | ||
} | ||
] | ||
}, | ||
"$.*": { | ||
"combine": "AND", | ||
"matchers": [ | ||
{ | ||
"match": "type" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
{ | ||
"generators": { }, | ||
"index": 1, | ||
"rules": { | ||
"$.name": { | ||
"combine": "AND", | ||
"matchers": [ | ||
{ | ||
"match": "regex", | ||
"regex": "delete\\-item" | ||
} | ||
] | ||
}, | ||
"$.method": { | ||
"combine": "AND", | ||
"matchers": [ | ||
{ | ||
"match": "regex", | ||
"regex": "DELETE" | ||
} | ||
] | ||
}, | ||
"$.*": { | ||
"combine": "AND", | ||
"matchers": [ | ||
{ | ||
"match": "type" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
compatibility-suite/pact-compatibility-suite/fixtures/eachkey-matcher-v4.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,19 @@ | ||
{ | ||
"body": { | ||
"$": { | ||
"combine": "AND", | ||
"matchers": [ | ||
{ | ||
"match": "eachKey", | ||
"rules": [ | ||
{ | ||
"match": "regex", | ||
"regex": "[a-z]+" | ||
} | ||
], | ||
"value": "one" | ||
} | ||
] | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
compatibility-suite/pact-compatibility-suite/fixtures/eachvalue-matcher-v4.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,19 @@ | ||
{ | ||
"body": { | ||
"$": { | ||
"combine": "AND", | ||
"matchers": [ | ||
{ | ||
"match": "eachValue", | ||
"rules": [ | ||
{ | ||
"match": "regex", | ||
"regex": "[a-z]+" | ||
} | ||
], | ||
"value": "one" | ||
} | ||
] | ||
} | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
compatibility-suite/pact-compatibility-suite/fixtures/siren.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,65 @@ | ||
{ | ||
"class": [ | ||
"order" | ||
], | ||
"properties": { | ||
"orderNumber": 42, | ||
"itemCount": 3, | ||
"status": "pending" | ||
}, | ||
"entities": [ | ||
{ | ||
"class": [ | ||
"items", | ||
"collection" | ||
], | ||
"rel": [ "http://x.io/rels/order-items" ], | ||
"href": "http://api.x.io/orders/42/items" | ||
}, | ||
{ | ||
"class": [ | ||
"info", | ||
"customer" | ||
], | ||
"rel": [ "http://x.io/rels/customer" ], | ||
"properties": { | ||
"customerId": "pj123", | ||
"name": "Peter Joseph" | ||
}, | ||
"links": [ | ||
{ | ||
"rel": [ "self" ], | ||
"href": "http://api.x.io/customers/pj123" | ||
} | ||
] | ||
} | ||
], | ||
"actions": [ | ||
{ | ||
"name": "add-item", | ||
"title": "Add Item", | ||
"method": "POST", | ||
"href": "http://api.x.io/orders/42/items" | ||
}, | ||
{ | ||
"name": "delete-item", | ||
"title": "Delete Item", | ||
"method": "DELETE", | ||
"href": "http://api.x.io/orders/42/items" | ||
} | ||
], | ||
"links": [ | ||
{ | ||
"rel": [ "self" ], | ||
"href": "http://api.x.io/orders/42" | ||
}, | ||
{ | ||
"rel": [ "previous" ], | ||
"href": "http://api.x.io/orders/41" | ||
}, | ||
{ | ||
"rel": [ "next" ], | ||
"href": "http://api.x.io/orders/43" | ||
} | ||
] | ||
} |
71 changes: 71 additions & 0 deletions
71
compatibility-suite/pact-compatibility-suite/fixtures/siren2.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,71 @@ | ||
{ | ||
"class": [ | ||
"order" | ||
], | ||
"properties": { | ||
"orderNumber": 42, | ||
"itemCount": 3, | ||
"status": "pending" | ||
}, | ||
"entities": [ | ||
{ | ||
"class": [ | ||
"items", | ||
"collection" | ||
], | ||
"rel": [ "http://x.io/rels/order-items" ], | ||
"href": "http://api.x.io/orders/42/items" | ||
}, | ||
{ | ||
"class": [ | ||
"info", | ||
"customer" | ||
], | ||
"rel": [ "http://x.io/rels/customer" ], | ||
"properties": { | ||
"customerId": "pj123", | ||
"name": "Peter Joseph" | ||
}, | ||
"links": [ | ||
{ | ||
"rel": [ "self" ], | ||
"href": "http://api.x.io/customers/pj123" | ||
} | ||
] | ||
} | ||
], | ||
"actions": [ | ||
{ | ||
"name": "delete-item", | ||
"title": "Delete Item", | ||
"method": "DELETE", | ||
"href": "http://api.x.io/orders/42/items" | ||
}, | ||
{ | ||
"name": "add-item", | ||
"title": "Add Item", | ||
"method": "POST", | ||
"href": "http://api.x.io/orders/42/items" | ||
}, | ||
{ | ||
"name": "update-item", | ||
"title": "Update Item", | ||
"method": "PUT", | ||
"href": "http://api.x.io/orders/42/items" | ||
} | ||
], | ||
"links": [ | ||
{ | ||
"rel": [ "self" ], | ||
"href": "http://api.x.io/orders/42" | ||
}, | ||
{ | ||
"rel": [ "previous" ], | ||
"href": "http://api.x.io/orders/41" | ||
}, | ||
{ | ||
"rel": [ "next" ], | ||
"href": "http://api.x.io/orders/43" | ||
} | ||
] | ||
} |
Oops, something went wrong.