Skip to content

Instantly share code, notes, and snippets.

@nikoly
Last active August 9, 2017 09:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikoly/7ea5255d4f6558680721c412ba7f2b40 to your computer and use it in GitHub Desktop.
Save nikoly/7ea5255d4f6558680721c412ba7f2b40 to your computer and use it in GitHub Desktop.
Provider contract instructions with Pact
{
"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