-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMock_alunos.xml
More file actions
260 lines (216 loc) · 9.58 KB
/
Mock_alunos.xml
File metadata and controls
260 lines (216 loc) · 9.58 KB
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
<?xml version="1.0" encoding="UTF-8"?>
<con:soapui-project id="e5740659-1b96-42fe-a381-53f799f814da" activeEnvironment="Default" name="DadosAlunos" resourceRoot="${projectDir}" soapui-version="5.3.0" abortOnError="false" runType="SEQUENTIAL" xmlns:con="http://eviware.com/soapui/config"><con:settings/><con:restMockService id="92069bd1-18ab-44e7-9fd8-cabd0609d405" port="8088" path="/" host="localhost" name="AlunoService" docroot=""><con:settings/><con:properties/><con:restMockAction name="/alunos" method="GET" resourcePath="/alunos" id="9a5a544d-57ad-430b-b3ce-965b578d397c"><con:settings/><con:defaultResponse xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><con:dispatchStyle>SEQUENCE</con:dispatchStyle><con:dispatchPath>/*
// Script dispatcher is used to select a response based on the incoming request.
// Here are few examples showing how to match based on path, query param, header and body
// Match based on path
def requestPath = mockRequest.getPath()
log.info "Path: "+ requestPath
if( requestPath.contains("json") )
{
// return the name of the response you want to dispatch
return "JSON Response"
}
// Match based on query parameter
def queryString = mockRequest.getRequest().getQueryString()
log.info "QueryString: " + queryString
if( queryString.contains("stockholm") )
{
// return the name of the response you want to dispatch
return "Response Stockholm"
}
else if( queryString.contains("london") )
{
// return the name of the response you want to dispatch
return "Response London"
}
// Match based on header
def acceptEncodingHeaderList = mockRequest.getRequestHeaders().get("Accept-Encoding")
log.info "AcceptEncoding Header List: " + acceptEncodingHeaderList
if( acceptEncodingHeaderList.contains("gzip,deflate") )
{
// return the name of the response you want to dispatch
return "GZiped Response"
}
// Match based on body
def requestBody = mockRequest.getRequestContent()
log.info "Request body: " + requestBody
if( requestBody.contains("some data") )
{
// return the name of the response you want to dispatch
return "Response N"
}
*/
</con:dispatchPath><con:response name="listaAlunos" id="69bcfa5c-1300-4a27-93f2-b27eacf09486" httpResponseStatus="200" mediaType="application/json"><con:settings/><con:responseContent>[
{
"cpf": "123",
"nome": "Danilo Ferreira",
"endereco": "Rua Professor Queiroz Filho, 312",
"cep": "37550-000",
"email": "appstudentemailsender@gmail.com"
},
{
"cpf": "456",
"nome": "Sarina Torres",
"endereco": "Rua Professor Queiroz Filho, 312",
"cep": "37550-000",
"email": "appstudentemailsender@gmail.com"
},
{
"cpf": "789",
"nome": "Um nome qualquer",
"endereco": "Uma rua qualquer, 500",
"cep": "37550-000",
"email": "appstudentemailsender@gmail.com"
},
{
"cpf": "111",
"nome": "Outro nome",
"endereco": "Outra rua, 100",
"cep": "37550-000",
"email": "appstudentemailsender@gmail.com"
}
]</con:responseContent><con:header><con:name>status</con:name><con:value>todosAlunos</con:value></con:header></con:response></con:restMockAction></con:restMockService><con:restMockService id="2ef9d6a7-117d-4522-9119-a14831722f0d" port="8089" path="/" host="localhost" name="NotasAlunosService" docroot=""><con:settings/><con:properties/><con:restMockAction name="/alunos/123/notas" method="GET" resourcePath="/alunos/123/notas" id="faf25ea6-4eb6-482f-993b-b0b06872822a"><con:settings/><con:defaultResponse>notasAluno</con:defaultResponse><con:dispatchStyle>SEQUENCE</con:dispatchStyle><con:dispatchPath>/*
// Script dispatcher is used to select a response based on the incoming request.
// Here are few examples showing how to match based on path, query param, header and body
// Match based on path
def requestPath = mockRequest.getPath()
log.info "Path: "+ requestPath
if( requestPath.contains("json") )
{
// return the name of the response you want to dispatch
return "JSON Response"
}
// Match based on query parameter
def queryString = mockRequest.getRequest().getQueryString()
log.info "QueryString: " + queryString
if( queryString.contains("stockholm") )
{
// return the name of the response you want to dispatch
return "Response Stockholm"
}
else if( queryString.contains("london") )
{
// return the name of the response you want to dispatch
return "Response London"
}
// Match based on header
def acceptEncodingHeaderList = mockRequest.getRequestHeaders().get("Accept-Encoding")
log.info "AcceptEncoding Header List: " + acceptEncodingHeaderList
if( acceptEncodingHeaderList.contains("gzip,deflate") )
{
// return the name of the response you want to dispatch
return "GZiped Response"
}
// Match based on body
def requestBody = mockRequest.getRequestContent()
log.info "Request body: " + requestBody
if( requestBody.contains("some data") )
{
// return the name of the response you want to dispatch
return "Response N"
}
*/
</con:dispatchPath><con:response name="notasAluno" id="b3080ee1-edc0-407d-b867-e34edf841e9b" httpResponseStatus="200" mediaType="application/json"><con:settings/><con:responseContent>{
"cpf": "123",
"notas": {
"disciplina1": 8,
"disciplina2": 3.5,
"disciplina3": 9
}
}</con:responseContent><con:header><con:name>status</con:name><con:value>notaAluno123</con:value></con:header></con:response></con:restMockAction><con:restMockAction name="/alunos/456/notas" method="GET" resourcePath="/alunos/456/notas" id="25ee527e-a9ed-4e01-beeb-5a42dbe580fa"><con:settings/><con:defaultResponse>notasAluno</con:defaultResponse><con:dispatchStyle>SEQUENCE</con:dispatchStyle><con:dispatchPath>/*
// Script dispatcher is used to select a response based on the incoming request.
// Here are few examples showing how to match based on path, query param, header and body
// Match based on path
def requestPath = mockRequest.getPath()
log.info "Path: "+ requestPath
if( requestPath.contains("json") )
{
// return the name of the response you want to dispatch
return "JSON Response"
}
// Match based on query parameter
def queryString = mockRequest.getRequest().getQueryString()
log.info "QueryString: " + queryString
if( queryString.contains("stockholm") )
{
// return the name of the response you want to dispatch
return "Response Stockholm"
}
else if( queryString.contains("london") )
{
// return the name of the response you want to dispatch
return "Response London"
}
// Match based on header
def acceptEncodingHeaderList = mockRequest.getRequestHeaders().get("Accept-Encoding")
log.info "AcceptEncoding Header List: " + acceptEncodingHeaderList
if( acceptEncodingHeaderList.contains("gzip,deflate") )
{
// return the name of the response you want to dispatch
return "GZiped Response"
}
// Match based on body
def requestBody = mockRequest.getRequestContent()
log.info "Request body: " + requestBody
if( requestBody.contains("some data") )
{
// return the name of the response you want to dispatch
return "Response N"
}
*/
</con:dispatchPath><con:response name="notasAluno" id="dadb927c-e353-48e8-8ad7-e5befb6df794" httpResponseStatus="200" mediaType="application/json"><con:settings/><con:responseContent>{
"cpf": "456",
"notas": {
"disciplina1": 6,
"disciplina2": 5,
"disciplina3": 9
}
}</con:responseContent><con:header><con:name>status</con:name><con:value>notasAluno456</con:value></con:header></con:response></con:restMockAction><con:restMockAction name="/alunos/789/notas" method="GET" resourcePath="/alunos/789/notas" id="cc707904-7cb6-4373-a872-2503ce3846a0"><con:settings/><con:defaultResponse>notasAluno</con:defaultResponse><con:dispatchStyle>SEQUENCE</con:dispatchStyle><con:dispatchPath>/*
// Script dispatcher is used to select a response based on the incoming request.
// Here are few examples showing how to match based on path, query param, header and body
// Match based on path
def requestPath = mockRequest.getPath()
log.info "Path: "+ requestPath
if( requestPath.contains("json") )
{
// return the name of the response you want to dispatch
return "JSON Response"
}
// Match based on query parameter
def queryString = mockRequest.getRequest().getQueryString()
log.info "QueryString: " + queryString
if( queryString.contains("stockholm") )
{
// return the name of the response you want to dispatch
return "Response Stockholm"
}
else if( queryString.contains("london") )
{
// return the name of the response you want to dispatch
return "Response London"
}
// Match based on header
def acceptEncodingHeaderList = mockRequest.getRequestHeaders().get("Accept-Encoding")
log.info "AcceptEncoding Header List: " + acceptEncodingHeaderList
if( acceptEncodingHeaderList.contains("gzip,deflate") )
{
// return the name of the response you want to dispatch
return "GZiped Response"
}
// Match based on body
def requestBody = mockRequest.getRequestContent()
log.info "Request body: " + requestBody
if( requestBody.contains("some data") )
{
// return the name of the response you want to dispatch
return "Response N"
}
*/
</con:dispatchPath><con:response name="notasAluno" id="b8a19539-3252-4576-86ed-71ef4d12806a" httpResponseStatus="200" mediaType="application/json"><con:settings/><con:responseContent>{
"cpf": "789",
"notas": {
"disciplina1": 7,
"disciplina2": 6.5,
"disciplina3": 9
}
}</con:responseContent><con:header><con:name>status</con:name><con:value>notasAluno789</con:value></con:header></con:response></con:restMockAction></con:restMockService><con:properties/><con:wssContainer/><con:oAuth2ProfileContainer/><con:oAuth1ProfileContainer/></con:soapui-project>