]> git.r.bdr.sh - rbdr/forum/blob - pacts/forumsstore-forumapiserver.json
Add pact test for forums store
[rbdr/forum] / pacts / forumsstore-forumapiserver.json
1 {
2 "consumer": {
3 "name": "ForumsStore"
4 },
5 "provider": {
6 "name": "ForumAPIServer"
7 },
8 "interactions": [
9 {
10 "description": "a request to list the forums",
11 "request": {
12 "method": "POST",
13 "path": "/graphql",
14 "headers": {
15 "content-type": "application/json"
16 },
17 "body": {
18 "operationName": "GetForums",
19 "query": "query GetForums {\n forums {\n id\n glyph\n label\n position\n __typename\n }\n }",
20 "variables": {
21 }
22 },
23 "matchingRules": {
24 "$.body.query": {
25 "match": "regex",
26 "regex": "query\\s*GetForums\\s*\\{\\s*forums\\s*\\{\\s*id\\s*glyph\\s*label\\s*position\\s*__typename\\s*\\}\\s*\\}"
27 }
28 }
29 },
30 "response": {
31 "status": 200,
32 "headers": {
33 "Content-Type": "application/json; charset=utf-8"
34 },
35 "body": {
36 "data": {
37 "forums": [
38 {
39 "id": "butter",
40 "glyph": "⌘",
41 "label": "test_forums.butter",
42 "position": 1
43 }
44 ]
45 }
46 },
47 "matchingRules": {
48 "$.body.data.forums": {
49 "min": 1
50 },
51 "$.body.data.forums[*].*": {
52 "match": "type"
53 },
54 "$.body.data.forums[*].id": {
55 "match": "type"
56 },
57 "$.body.data.forums[*].glyph": {
58 "match": "type"
59 },
60 "$.body.data.forums[*].label": {
61 "match": "type"
62 },
63 "$.body.data.forums[*].position": {
64 "match": "type"
65 }
66 }
67 }
68 }
69 ],
70 "metadata": {
71 "pactSpecification": {
72 "version": "2.0.0"
73 }
74 }
75 }