-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmock_example.yml
223 lines (219 loc) · 5.57 KB
/
mock_example.yml
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
consulAgents:
-
enabled: false
consulHost: 127.0.0.1
consulPort: 8500
services:
-
serviceId: customer-data-service
serviceName: customer-data-service
servicePort: 8081
serviceAddress: 127.0.0.1
checkInterval: 30s
checkTimeout: 30s
proxies:
-
enabled: true
httpServer:
name: auth
port: 9090
host: 127.0.0.1
forwardTo: "https://auth.testlab.com:9090"
writeTo: "/tmp/auth.yml"
-
enabled: true
httpServer:
name: esb
port: 9091
host: 127.0.0.1
forwardTo: "https://esb.testlab.com:9091"
writeTo: "/tmp/proxy.yml"
springConfig:
enabled: true
refreshPeriod: 10000
sourceFolder: ./src/test/resources/springconfig/
profiles:
- dev
- qa
- default
httpServer:
name: spring-config-httpServer
port: 8888
host: 127.0.0.1
ssl:
enabled: true
keyStoreLocation: mock_keystore.jks
keyStorePassword: mockpassword
routes:
-
httpMethod: GET
url: /testNoContent
contentType: text/plain
responseBody: This content will be ignored
code: 204
httpServers:
-
enabled: true
name: firstServer
port: 8081
routes:
-
httpMethod: GET
url: /testNoContent
contentType: text/plain
responseBody: This content will be ignored
code: 204
-
httpMethod: GET
url: /testGetText
contentType: text/plain
responseBody: Hello World. Plain Text.
code: 200
-
httpMethod: GET
url: /testGetTextSecuredRoute
contentType: text/plain
headerAuth:
enabled: true
name: X-TOKEN-HEADER
value: 69b30db6-1238-11e7-93ae-92361f002671
responseBody: Hello World. This is a header based secured area
code: 200
-
httpMethod: GET
url: /testGetTextWithParameters
contentType: text/plain
responseBody: Here is the parameter ${testP} and other ${someElse}
code: 200
-
httpMethod: GET
url: /giveMeCookies
contentType: text/plain
responseBody: Hello. Take your cookies
code: 200
cookies:
-
name: cookieName
value: cookieValue
path: /
maxAge: 3600
secure: true
domain: 127.0.0.1
comment: someComment
-
httpMethod: GET
url: /anymask/*/anypath/
contentType: text/plain
responseBody: Hello World. Test url mask with additional text
code: 200
-
httpMethod: GET
url: /somemask/*/somepath/*/somepath
contentType: text/plain
responseBody: Some Complicated Path
code: 200
-
httpMethod: POST
url: /testGetText
contentType: text/plain
responseBody: Hello World Again. Plain Text.
code: 200
-
httpMethod: GET
url: /testGetJson
contentType: application/json
responseBody: '{"name": "Korben Dallas"}'
code: 200
-
httpMethod: POST
url: /oauth/token
contentType: "application/json"
responseBody: '{"access_token" : "ya29S6ZQbiBQpA5Rz8oty00xj-xydfdfddteerer-1eM", "token_type" : "Bearer", "expires_in" : 3600}'
responseHeaders: {"X-java-version" : "1.8", "X-builder" : "gradle"}
code: 200
logRequest: true
logResponse: true
-
httpMethod: DELETE
url: /deleteResource
contentType: text/plain
responseBody: OK
code: 200
-
httpMethod: PATCH
url: /patchResource
contentType: application/json
responseBody: '{"patchedParameter": "patchedVariable with error"}'
code: 500
-
httpMethod: GET
url: /testcallback
contentType: application/json
responseBody: '{}'
code: 200
callback:
enabled: true
httpMethod: POST
url: https://127.0.0.1:8084/callbacks_request
requestHeaders: {"X-HEADER1" : "X-HEADER1-VALUE", "X-HEADER2" : "X-HEADER2-VALUE"}
requestBody: "{yo}"
-
httpMethod: GET
url: /delayTest
delay: 1000
contentType: text/plain
responseBody: This content will be ignored
code: 200
-
name: secondServer
port: 8082
minThreads: 10
maxThreads: 20
idleTimeout: 60000
ssl:
enabled: true
keyStoreLocation: mock_keystore.jks
keyStorePassword: mockpassword
routes:
-
httpMethod: GET
url: /testGetText
contentType: text/plain
responseBody: Content from the second server
code: 200
-
name: thirdServer
port: 8083
minThreads: 10
maxThreads: 20
idleTimeout: 60000
virtualHosts:
- "vhost.mocka"
ssl:
enabled: true
keyStoreLocation: mock_keystore.jks
keyStorePassword: mockpassword
routes:
-
httpMethod: GET
url: /testGetText
contentType: text/plain
responseBody: Content from the third server
code: 200
-
name: callbackserver
port: 8084
capture:
enabled: true
ssl:
enabled: true
keyStoreLocation: mock_keystore.jks
keyStorePassword: mockpassword
routes:
-
httpMethod: POST
url: /callbacks_request
contentType: text/plain
responseBody: Content from the callback server
responseHeaders: {"X-Java-Version" : "1.8", "X-Builder" : "gradle"}
code: 200