-
-
Notifications
You must be signed in to change notification settings - Fork 82
/
test-config.json
143 lines (143 loc) · 3.66 KB
/
test-config.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
{
"note": "used for functional tests.",
"mockDirectory": "./samplemocks/",
"port": "7879",
"latency": 0,
"allowedDomains": ["abc"],
"allowedHeaders": ["Content-Type", "my-custom-header"],
"proxyURL": "http://localhost:7881",
"webServices": {
"first": {
"mockFile": "king.json",
"contentType": "foobar",
"verbs": ["get"],
"alternatePaths": ["1st"]
},
"second": {
"verbs": ["delete"],
"httpStatus": 204
},
"royals": {
"verbs": ["get", "post"],
"responses": {
"get": {
"mockFile": "ace.json"
},
"post": {
"mockFile": "king.json"
}
}
},
"protected": {
"mockFile": "king.json",
"httpStatus": 403,
"verbs": ["put"]
},
"nested/ace": {
"mockFile": "ace.json",
"verbs": ["post", "get"],
"switch": "customerId"
},
"var/:id": {
"mockFile": "xml/queen.xml",
"verbs": ["all"]
},
"login": {
"mockFile": "king.json",
"verbs": ["post"],
"switch": ["userId", "password"],
"responses": {
"post": {"httpStatus": 401}
},
"switchResponses": {
"userIduser1passwordgood": {"httpStatus": 200}
}
},
"verify": {
"verbs": ["post"],
"switch": ["customerId"],
"switchResponses": {
"customerId1234": {"mockFile": "ace.json"}
}
},
"firstheaders": {
"mockFile": "king.json",
"contentType": "foobar",
"headers": {
"x-requested-by": "4c2df03a17a803c063f21aa86a36f6f55bdde1f85b89e49ee1b383f281d18c09c2ba30654090df3531cd2318e3c",
"dummyheader": "dummyvalue"
},
"verbs": ["get"]
},
"noMockFile": {
"verbs": ["get"]
},
"missingMockFile": {
"verbs": ["get"],
"mockFile": "missing",
"httpStatus": 203
},
"template/:name/:number":{
"mockFile":"templateSample.json",
"enableTemplate" : true,
"contentType": "application/json",
"verbs": ["get"]
},
"templateSwitchGetParams" : {
"mockFile": "templateSwitchSample.json",
"verbs":["get"],
"templateSwitch": ["appID",
"appName",
"userName",
"userAge"],
"contentType": "application/json"
},
"templateSwitchPostJsonPath" : {
"mockFile": "templateSwitchSample.json",
"verbs": ["post"],
"templateSwitch": [{"key": "appID",
"switch": "$.data.appID",
"type": "jsonpath"},
{"key": "appName",
"switch": "$.data.appName",
"type": "jsonpath"},
{"key": "userName",
"switch": "$.data.user.userName",
"type": "jsonpath"},
{"key": "userAge",
"switch": "$.data.user.userAge",
"type": "jsonpath"}],
"contentType": "application/json"
},
"users": {
"mockFile": "users.json",
"verbs": [
"get"
]
},
"users/:id": {
"mockFile": "users.json",
"verbs": [
"get"
],
"switch": "id",
"jsonPathSwitchResponse": {
"jsonpath": "$[?(@.id==#id#)]",
"mockFile": "users.json",
"forceFirstObject": true
}
},
"users/role/:role": {
"mockFile": "users.json",
"verbs": [
"get"
],
"switch": "role",
"jsonPathSwitchResponse": {
"jsonpath": "$[?(@.role==\"#role#\")]",
"mockFile": "users.json",
"forceFirstObject": false
}
}
}
}