@@ -15,58 +15,58 @@ def queryString = mockRequest.getRequest().getQueryString()
15
15
log.info "QueryString: " + queryString
16
16
17
17
18
- /*
19
- // Script dispatcher is used to select a response based on the incoming request.
20
- // Here are few examples showing how to match based on path, query param, header and body
21
-
22
- // Match based on path
23
- def requestPath = mockRequest.getPath()
24
- log.info "Path: "+ requestPath
25
-
26
- if( requestPath.contains("json") )
27
- {
28
- // return the name of the response you want to dispatch
29
- return "JSON Response"
30
- }
31
-
32
-
33
- // Match based on query parameter
34
- def queryString = mockRequest.getRequest().getQueryString()
35
- log.info "QueryString: " + queryString
36
-
37
- if( queryString.contains("stockholm") )
38
- {
39
- // return the name of the response you want to dispatch
40
- return "Response Stockholm"
41
- }
42
- else if( queryString.contains("london") )
43
- {
44
- // return the name of the response you want to dispatch
45
- return "Response London"
46
- }
47
-
48
-
49
- // Match based on header
50
- def acceptEncodingHeaderList = mockRequest.getRequestHeaders().get("Accept-Encoding")
51
- log.info "AcceptEncoding Header List: " + acceptEncodingHeaderList
52
-
53
- if( acceptEncodingHeaderList.contains("gzip,deflate") )
54
- {
55
- // return the name of the response you want to dispatch
56
- return "GZiped Response"
57
- }
58
-
59
-
60
- // Match based on body
61
- def requestBody = mockRequest.getRequestContent()
62
- log.info "Request body: " + requestBody
63
-
64
- if( requestBody.contains("some data") )
65
- {
66
- // return the name of the response you want to dispatch
67
- return "Response N"
68
- }
69
- */
18
+ /*
19
+ // Script dispatcher is used to select a response based on the incoming request.
20
+ // Here are few examples showing how to match based on path, query param, header and body
21
+
22
+ // Match based on path
23
+ def requestPath = mockRequest.getPath()
24
+ log.info "Path: "+ requestPath
25
+
26
+ if( requestPath.contains("json") )
27
+ {
28
+ // return the name of the response you want to dispatch
29
+ return "JSON Response"
30
+ }
31
+
32
+
33
+ // Match based on query parameter
34
+ def queryString = mockRequest.getRequest().getQueryString()
35
+ log.info "QueryString: " + queryString
36
+
37
+ if( queryString.contains("stockholm") )
38
+ {
39
+ // return the name of the response you want to dispatch
40
+ return "Response Stockholm"
41
+ }
42
+ else if( queryString.contains("london") )
43
+ {
44
+ // return the name of the response you want to dispatch
45
+ return "Response London"
46
+ }
47
+
48
+
49
+ // Match based on header
50
+ def acceptEncodingHeaderList = mockRequest.getRequestHeaders().get("Accept-Encoding")
51
+ log.info "AcceptEncoding Header List: " + acceptEncodingHeaderList
52
+
53
+ if( acceptEncodingHeaderList.contains("gzip,deflate") )
54
+ {
55
+ // return the name of the response you want to dispatch
56
+ return "GZiped Response"
57
+ }
58
+
59
+
60
+ // Match based on body
61
+ def requestBody = mockRequest.getRequestContent()
62
+ log.info "Request body: " + requestBody
63
+
64
+ if( requestBody.contains("some data") )
65
+ {
66
+ // return the name of the response you want to dispatch
67
+ return "Response N"
68
+ }
69
+ */
70
70
</con : dispatchPath ><con : response name =" Success Reponse" id =" c2e01668-af95-4107-a0ee-e7e3bb76f9cd" httpResponseStatus =" 200" mediaType =" application/json" ><con : settings /><con : responseContent >{
71
71
"_links": {
72
72
"self": {
@@ -205,56 +205,56 @@ if( requestBody.contains("some data") )
205
205
return "Response N"
206
206
}
207
207
*/
208
- </con : dispatchPath ><con : response name =" Login Success Response" id =" 64361075-ae39-4ed8-8fbd-e837ad26e2bf" httpResponseStatus =" 200" mediaType =" application/json" ><con : settings /><con : responseContent /><con : header ><con : name >location</con : name ><con : value >/api/v1/session/df1bfacb-xxxx-xxxx-xxxx-c8f57d8f3c7</con : value ></con : header ></con : response ><con : response name =" Login Failed Reponse" id =" 30731a63-ba64-41c1-820d-fbee088e4023" httpResponseStatus =" 401" ><con : settings /><con : responseContent /></con : response ></con : restMockAction ><con : restMockAction name =" /api/v1 /license" method =" GET" resourcePath =" /api/v1 /license" id =" 777458a5-c2f1-434f-bc62-93536aec73b0" ><con : settings /><con : dispatchStyle >SEQUENCE</con : dispatchStyle ><con : dispatchPath >/*
209
- // Script dispatcher is used to select a response based on the incoming request.
210
- // Here are few examples showing how to match based on path, query param, header and body
211
-
212
- // Match based on path
213
- def requestPath = mockRequest.getPath()
214
- log.info "Path: "+ requestPath
215
-
216
- if( requestPath.contains("json") )
217
- {
218
- // return the name of the response you want to dispatch
219
- return "JSON Response"
220
- }
221
-
222
-
223
- // Match based on query parameter
224
- def queryString = mockRequest.getRequest().getQueryString()
225
- log.info "QueryString: " + queryString
226
-
227
- if( queryString.contains("stockholm") )
228
- {
229
- // return the name of the response you want to dispatch
230
- return "Response Stockholm"
231
- }
232
- else if( queryString.contains("london") )
233
- {
234
- // return the name of the response you want to dispatch
235
- return "Response London"
236
- }
237
-
238
-
239
- // Match based on header
240
- def acceptEncodingHeaderList = mockRequest.getRequestHeaders().get("Accept-Encoding")
241
- log.info "AcceptEncoding Header List: " + acceptEncodingHeaderList
242
-
243
- if( acceptEncodingHeaderList.contains("gzip,deflate") )
244
- {
245
- // return the name of the response you want to dispatch
246
- return "GZiped Response"
247
- }
248
-
249
-
250
- // Match based on body
251
- def requestBody = mockRequest.getRequestContent()
252
- log.info "Request body: " + requestBody
253
-
254
- if( requestBody.contains("some data") )
255
- {
256
- // return the name of the response you want to dispatch
257
- return "Response N"
258
- }
259
- */
260
- </con : dispatchPath ><con : response name =" Success Response" id =" 99316eed-7a8f-43b6-8b94-14c737654ed9" httpResponseStatus =" 200" ><con : settings /><con : responseContent /></con : response ></con : restMockAction ></con : restMockService ><con : properties /><con : wssContainer /><con : oAuth2ProfileContainer /><con : oAuth1ProfileContainer /></con : soapui-project >
208
+ </con : dispatchPath ><con : response name =" Login Success Response" id =" 64361075-ae39-4ed8-8fbd-e837ad26e2bf" httpResponseStatus =" 200" mediaType =" application/json" ><con : settings /><con : responseContent /><con : header ><con : name >location</con : name ><con : value >/api/v1/session/df1bfacb-xxxx-xxxx-xxxx-c8f57d8f3c7</con : value ></con : header ></con : response ><con : response name =" Login Failed Reponse" id =" 30731a63-ba64-41c1-820d-fbee088e4023" httpResponseStatus =" 401" ><con : settings /><con : responseContent /></con : response ></con : restMockAction ><con : restMockAction name =" /api/v2 /license" method =" GET" resourcePath =" /api/v2 /license" id =" 777458a5-c2f1-434f-bc62-93536aec73b0" ><con : settings /><con : dispatchStyle >SEQUENCE</con : dispatchStyle ><con : dispatchPath >/*
209
+ // Script dispatcher is used to select a response based on the incoming request.
210
+ // Here are few examples showing how to match based on path, query param, header and body
211
+
212
+ // Match based on path
213
+ def requestPath = mockRequest.getPath()
214
+ log.info "Path: "+ requestPath
215
+
216
+ if( requestPath.contains("json") )
217
+ {
218
+ // return the name of the response you want to dispatch
219
+ return "JSON Response"
220
+ }
221
+
222
+
223
+ // Match based on query parameter
224
+ def queryString = mockRequest.getRequest().getQueryString()
225
+ log.info "QueryString: " + queryString
226
+
227
+ if( queryString.contains("stockholm") )
228
+ {
229
+ // return the name of the response you want to dispatch
230
+ return "Response Stockholm"
231
+ }
232
+ else if( queryString.contains("london") )
233
+ {
234
+ // return the name of the response you want to dispatch
235
+ return "Response London"
236
+ }
237
+
238
+
239
+ // Match based on header
240
+ def acceptEncodingHeaderList = mockRequest.getRequestHeaders().get("Accept-Encoding")
241
+ log.info "AcceptEncoding Header List: " + acceptEncodingHeaderList
242
+
243
+ if( acceptEncodingHeaderList.contains("gzip,deflate") )
244
+ {
245
+ // return the name of the response you want to dispatch
246
+ return "GZiped Response"
247
+ }
248
+
249
+
250
+ // Match based on body
251
+ def requestBody = mockRequest.getRequestContent()
252
+ log.info "Request body: " + requestBody
253
+
254
+ if( requestBody.contains("some data") )
255
+ {
256
+ // return the name of the response you want to dispatch
257
+ return "Response N"
258
+ }
259
+ */
260
+ </con : dispatchPath ><con : response name =" Success Response" id =" 99316eed-7a8f-43b6-8b94-14c737654ed9" httpResponseStatus =" 200" ><con : settings /><con : responseContent /></con : response ></con : restMockAction ></con : restMockService ><con : properties /><con : wssContainer /><con : oAuth2ProfileContainer /><con : oAuth1ProfileContainer /></con : soapui-project >
0 commit comments