diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-05-02 00:23:16 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-05-02 00:23:16 +0200 |
| commit | 73973edab9aaa81312ba80a68bfe34bf5abcecd9 (patch) | |
| tree | 9d3916655c416407e12dc66e9f1f865cec0fb2b3 /pacts/forumsstore-forumapiserver.json | |
| parent | 55fb920baa9792266be1a6b981f954c622c1eaf9 (diff) | |
Add pact test for forums store
Diffstat (limited to 'pacts/forumsstore-forumapiserver.json')
| -rw-r--r-- | pacts/forumsstore-forumapiserver.json | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/pacts/forumsstore-forumapiserver.json b/pacts/forumsstore-forumapiserver.json new file mode 100644 index 0000000..26a2810 --- /dev/null +++ b/pacts/forumsstore-forumapiserver.json @@ -0,0 +1,75 @@ +{ + "consumer": { + "name": "ForumsStore" + }, + "provider": { + "name": "ForumAPIServer" + }, + "interactions": [ + { + "description": "a request to list the forums", + "request": { + "method": "POST", + "path": "/graphql", + "headers": { + "content-type": "application/json" + }, + "body": { + "operationName": "GetForums", + "query": "query GetForums {\n forums {\n id\n glyph\n label\n position\n __typename\n }\n }", + "variables": { + } + }, + "matchingRules": { + "$.body.query": { + "match": "regex", + "regex": "query\\s*GetForums\\s*\\{\\s*forums\\s*\\{\\s*id\\s*glyph\\s*label\\s*position\\s*__typename\\s*\\}\\s*\\}" + } + } + }, + "response": { + "status": 200, + "headers": { + "Content-Type": "application/json; charset=utf-8" + }, + "body": { + "data": { + "forums": [ + { + "id": "butter", + "glyph": "⌘", + "label": "test_forums.butter", + "position": 1 + } + ] + } + }, + "matchingRules": { + "$.body.data.forums": { + "min": 1 + }, + "$.body.data.forums[*].*": { + "match": "type" + }, + "$.body.data.forums[*].id": { + "match": "type" + }, + "$.body.data.forums[*].glyph": { + "match": "type" + }, + "$.body.data.forums[*].label": { + "match": "type" + }, + "$.body.data.forums[*].position": { + "match": "type" + } + } + } + } + ], + "metadata": { + "pactSpecification": { + "version": "2.0.0" + } + } +}
\ No newline at end of file |