Last active
August 9, 2017 09:58
-
-
Save nikoly/7ea5255d4f6558680721c412ba7f2b40 to your computer and use it in GitHub Desktop.
Provider contract instructions with Pact
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
{ | |
"consumer": { | |
"name": "Translator" | |
}, | |
"provider": { | |
"name": "Translate Service" | |
}, | |
"interactions": [ | |
{ | |
"description": "a request to get translation for number one", | |
"providerState": "translation for number 1", | |
"request": { | |
"method": "get", | |
"path": "/translate/1" | |
}, | |
"response": { | |
"status": 200, | |
"headers": { | |
}, | |
"body": { | |
"ua": "Один", | |
"en": "One" | |
} | |
} | |
}, | |
{ | |
"description": "a request to get translation for number minus one", | |
"providerState": "translation for number -1 doesn't exist", | |
"request": { | |
"method": "get", | |
"path": "/translate/-1" | |
}, | |
"response": { | |
"status": 404, | |
"headers": { | |
} | |
} | |
} | |
], | |
"metadata": { | |
"pactSpecification": { | |
"version": "1.0.0" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment