-
-
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.
added specification tests for header matching
- Loading branch information
Ronald Holshausen
committed
Jun 10, 2015
1 parent
3677c6b
commit ea4bd36
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
pact-specification-test/src/main/resources/request/headers/matches with regex.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,23 @@ | ||
{ | ||
"match": true, | ||
"comment": "Headers match with regexp", | ||
"expected" : { | ||
"method": "POST", | ||
"path": "/path", | ||
"headers": { | ||
"Accept": "alligators", | ||
"Content-Type": "hippos" | ||
}, | ||
"requestMatchingRules": { | ||
"$.headers.Accept": {"regex": "\\w+"} | ||
} | ||
}, | ||
"actual": { | ||
"method": "POST", | ||
"path": "/path", | ||
"headers": { | ||
"Content-Type": "hippos", | ||
"Accept": "crocodiles" | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
pact-specification-test/src/main/resources/response/headers/matches with regex.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,20 @@ | ||
{ | ||
"match": true, | ||
"comment": "Headers match with regex", | ||
"expected" : { | ||
"headers": { | ||
"Accept": "alligators", | ||
"Content-Type": "hippos" | ||
}, | ||
"responseMatchingRules": { | ||
"$.headers.Accept": {"regex": "\\w+"} | ||
} | ||
}, | ||
"actual": { | ||
"headers": { | ||
"Content-Type": "hippos", | ||
"Accept": "godzilla" | ||
} | ||
} | ||
} | ||
|