Created
January 14, 2017 00:36
-
-
Save fitzoh/f51e5a3658e9a6d340a5ac4260bbf6eb to your computer and use it in GitHub Desktop.
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
{ | |
"provider": { | |
"name": "Provider" | |
}, | |
"consumer": { | |
"name": "Consumer" | |
}, | |
"interactions": [ | |
{ | |
"description": "A fraudulent fraud check request", | |
"request": { | |
"method": "PUT", | |
"path": "/fraudcheck", | |
"headers": { | |
"Content-Type": "application/vnd.fraud.v1+json" | |
}, | |
"body": { | |
"clientId": "1234567890", | |
"loanAmount": 99999 | |
}, | |
"matchingRules": { | |
"$.body.clientId": { | |
"regex": "[0-9]{10}" | |
}, | |
"$.body.loanAmount": { | |
"match": "type" | |
} | |
} | |
}, | |
"response": { | |
"status": 200, | |
"headers": { | |
"Content-Type": "application/vnd.fraud.v1+json;charset=UTF-8" | |
}, | |
"body": { | |
"fraudCheckStatus": "FRAUD", | |
"rejectionReason": "Amount too high" | |
}, | |
"matchingRules": { | |
"$.body.fraudCheckStatus": { | |
"regex": "FRAUD" | |
} | |
} | |
} | |
}, | |
{ | |
"description": "A non-fraudulent fraud check request", | |
"request": { | |
"method": "PUT", | |
"path": "/fraudcheck", | |
"headers": { | |
"Content-Type": "application/vnd.fraud.v1+json" | |
}, | |
"body": { | |
"clientId": "1234567890", | |
"loanAmount": 123.123 | |
} | |
}, | |
"response": { | |
"status": 200, | |
"headers": { | |
"Content-Type": "application/vnd.fraud.v1+json;charset=UTF-8" | |
}, | |
"body": { | |
"fraudCheckStatus": "OK", | |
"rejectionReason": null | |
} | |
} | |
}, | |
{ | |
"description": "A request to get the drunks count", | |
"request": { | |
"method": "GET", | |
"path": "/drunks" | |
}, | |
"response": { | |
"status": 200, | |
"headers": { | |
"Content-Type": "application/vnd.fraud.v1+json;charset=UTF-8" | |
}, | |
"body": { | |
"count": 100 | |
} | |
} | |
}, | |
{ | |
"description": "A request to get the fraud count", | |
"request": { | |
"method": "GET", | |
"path": "/frauds" | |
}, | |
"response": { | |
"status": 200, | |
"headers": { | |
"Content-Type": "application/vnd.fraud.v1+json;charset=UTF-8" | |
}, | |
"body": { | |
"count": 200 | |
} | |
} | |
} | |
], | |
"metadata": { | |
"pact-specification": { | |
"version": "2.0.0" | |
}, | |
"pact-jvm": { | |
"version": "2.4.18" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment