-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMessageRequests.http
350 lines (272 loc) · 7.48 KB
/
MessageRequests.http
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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
###THIS TESTS CAN BE RUN IN ORDER WITHOUT CHANGES STARTING FROM A CLEAN DATABASE
### MESSAGE HTTP TEST
### Creating message with invalid sender: expected 400
POST http://localhost:8080/API/messages
Content-Type: application/json
{
"sender": "",
"channel": "telephone",
"priority": "High",
"subject": "Tizio{{$random.integer(0,1000)}}",
"body": "{{$random.uuid}}"
}
### Creating message with invalid channel: expected 400
POST http://localhost:8080/API/messages
Content-Type: application/json
{
"sender": "{{$random.email}}",
"channel": "",
"priority": "High",
"subject": "Tizio{{$random.integer(0,1000)}}",
"body": "{{$random.uuid}}"
}
### Creating message with valid parameters: expected 201
POST http://localhost:8080/API/messages
Content-Type: application/json
{
"sender": "{{$random.email}}",
"channel": "Telephone",
"priority": "High",
"subject": "Tizio{{$random.integer(0,1000)}}",
"body": "{{$random.uuid}}"
}
### Read all messages: always 200
GET http://localhost:8080/API/messages
### Read message by invalid id: expected 400
GET http://localhost:8080/API/messages/invalidstring
### Read message by absent id: expected 404
GET http://localhost:8080/API/messages/-1
### Change message status with invalid body: expected 400
POST http://localhost:8080/API/messages/1
Content-Type: application/json
{
"status": "",
"comment": ""
}
### Change message status with absent id: expected 404
POST http://localhost:8080/API/messages/-1
Content-Type: application/json
{
"status": "Done",
"comment": ""
}
### Change message status with invalid new status: expected 400
POST http://localhost:8080/API/messages/1
Content-Type: application/json
{
"status": "Done",
"comment": ""
}
### Change message status with valid new status: expected 200
POST http://localhost:8080/API/messages/1
Content-Type: application/json
{
"status": "Read",
"comment": ""
}
### Change message priority with an absent message id: expected 404
PUT http://localhost:8080/API/messages/-1/priority
Content-Type: application/json
{
"priority": "Medium"
}
### Change message priority with an invalid priority: expected 400
PUT http://localhost:8080/API/messages/1/priority
Content-Type: application/json
{
"priority": "INVALID"
}
### Change message priority with an valid priority: expected 200
PUT http://localhost:8080/API/messages/1/priority
Content-Type: application/json
{
"priority": "Medium"
}
### Read message by id: expected 200
GET http://localhost:8080/API/messages/1
### CONTACT HTTP TEST
### Get all contact: expected 200
GET http://localhost:8080/API/contacts?
page=0&
limit=50
### Create contact with a missing field: expected 400
POST http://localhost:8080/API/contacts
Content-Type: application/json
{
"name": "ciao",
"surname": "",
"category": "Unknown",
"telephones": [],
"emails": [],
"addresses": []
}
### Create contact: expected 201
POST http://localhost:8080/API/contacts
Content-Type: application/json
{
"name": "name1",
"surname": "surname1",
"category": "Unknown",
"telephones": [],
"emails": [],
"addresses": []
}
### Get all contact: expected 200
GET http://localhost:8080/API/contacts?
page=0&
limit=50
### Get contact by absent id: expected 404
GET http://localhost:8080/API/contacts/-1
### Get contact by invalid id: expected 400
GET http://localhost:8080/API/contacts/invalidid
### Get contact by id: expected 200
GET http://localhost:8080/API/contacts/2
### Update contact, absent id: expected 201
PUT http://localhost:8080/API/contacts/1
Content-Type: application/json
{
"name": "name2",
"surname": "surname2",
"category": "Unknown",
"telephones": [],
"emails": [],
"addresses": []
}
### Get all contact: expected 200
GET http://localhost:8080/API/contacts?
page=0&
limit=50
### Update contact: expected 201
PUT http://localhost:8080/API/contacts/2
Content-Type: application/json
{
"name": "rename11",
"surname": "surname11",
"category": "Unknown",
"telephones": [],
"emails": [],
"addresses": []
}
### Delete contact by id: 204
DELETE http://localhost:8080/API/contacts/3
### Delete contact by absent id: 404
DELETE http://localhost:8080/API/contacts/3
### Get all contact: expected 200
GET http://localhost:8080/API/contacts?
page=0&
limit=50
### MESSAGE-MAIL HTTP TEST
### Add mail to contact, absent id: 404
POST http://localhost:8080/API/contacts/-1/emails
Content-Type: application/json
{
"email": "[email protected]"
}
### Add mail to contact: 200
POST http://localhost:8080/API/contacts/4/emails
Content-Type: application/json
{
"email": "[email protected]"
}
### Get mails from a contact: 200
GET http://localhost:8080/API/contacts/4/emails
### Update mails from a contact: 201
PUT http://localhost:8080/API/contacts/4/emails/1
Content-Type: application/json
{
"email": "[email protected]"
}
### Delete mails from a contact: 204
DELETE http://localhost:8080/API/contacts/4/emails/2
### Delete mails from a contact, mail not found: 404
DELETE http://localhost:8080/API/contacts/4/emails/2
### MESSAGE-TELEPHON HTTP TEST
### Add telephon to contact, absent id: 404
POST http://localhost:8080/API/contacts/-1/telephones
Content-Type: application/json
{
"number": "3333333333"
}
### Add telephon to contact: 200
POST http://localhost:8080/API/contacts/4/telephones
Content-Type: application/json
{
"number": "3333333333"
}
### Get telephon from a contact: 200
GET http://localhost:8080/API/contacts/4/telephones
### Update telephon from a contact: 201
PUT http://localhost:8080/API/contacts/4/telephones/1
Content-Type: application/json
{
"number": "3333333334"
}
### Get telephon from a contact: 200
GET http://localhost:8080/API/contacts/4/telephones
### Delete telephon from a contact: 204
DELETE http://localhost:8080/API/contacts/4/telephones/2
### Delete telephon from a contact, telephon not found: 404
DELETE http://localhost:8080/API/contacts/4/telephones/2
### MESSAGE-ADDRESS HTTP TEST
### Ad address to contact, absent id: 404
POST http://localhost:8080/API/contacts/-1/addresses
Content-Type: application/json
{
"civic": "10",
"street": "test_street",
"city": "turin",
"postalCode": "10129"
}
### Add address to contact: 201
POST http://localhost:8080/API/contacts/4/addresses
Content-Type: application/json
{
"civic": "10",
"street": "test_street",
"city": "turin",
"postalCode": "10129"
}
### Get address from a contact: 200
GET http://localhost:8080/API/contacts/4/addresses
### Update address from a contact: 201
PUT http://localhost:8080/API/contacts/4/addresses/1
Content-Type: application/json
{
"civic": "42",
"street": "test_street2",
"city": "turin",
"postalCode": "10129"
}
### Get address from a contact: 200
GET http://localhost:8080/API/contacts/4/addresses
### Delete address from a contact: 204
DELETE http://localhost:8080/API/contacts/4/addresses/2
### Delete address from a contact, address not found: 404
DELETE http://localhost:8080/API/contacts/4/addresses/1
### testiamo
POST http://localhost:8080/API/customers/
Content-Type: application/json
{"contactId": 2}
### testiamo note
PUT http://localhost:8080/API/customers/1/note
Content-Type: application/json
{
"note": "pipipip"
}
### justtest
GET http://localhost:8080/API/customers/1
### create a job offer (expected 201)
POST http://localhost:8080/API/joboffers
Content-Type: application/json
{
"customerId": 1,
"description": "First joboffer",
"status": "Created",
"duration": 23,
"skills": [
"IT",
"Cloud"
]
}
### get a joboffer by id (expected 200)
GET http://localhost:8080/API/joboffers