blob: 123f5f57585b14fb2bc5cbce5344c8bef1754cf6 [file] [log] [blame]
Rene Robert53ef77f2019-01-24 18:24:55 +01001{
Rene Robert53ef77f2019-01-24 18:24:55 +01002 "info": {
Rene_Robert0ebd04f2019-07-30 17:11:26 +02003 "_postman_id": "fa388fc9-15ed-4e6c-8c47-96fdc4ac7f12",
Rene Robert53ef77f2019-01-24 18:24:55 +01004 "name": "01_Onboard_Vendor",
Rene Robert53ef77f2019-01-24 18:24:55 +01005 "description": "onboard new vendor",
Rene_Robert0ebd04f2019-07-30 17:11:26 +02006 "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
Rene Robert53ef77f2019-01-24 18:24:55 +01007 },
8 "item": [
9 {
10 "name": "Get Vendor before create",
11 "event": [
12 {
13 "listen": "test",
14 "script": {
Rene_Robert0ebd04f2019-07-30 17:11:26 +020015 "id": "2249b072-2689-45f3-87ea-a75da5802752",
Rene Robert53ef77f2019-01-24 18:24:55 +010016 "exec": [
Rene_Robert0ebd04f2019-07-30 17:11:26 +020017 "pm.test(\"Status code is 200\", function () {",
18 " pm.response.to.have.status(200);",
19 "});",
Rene Robert53ef77f2019-01-24 18:24:55 +010020 "",
Rene_Robert0ebd04f2019-07-30 17:11:26 +020021 "var jsonData = pm.response.json();",
22 "",
Rene Robert53ef77f2019-01-24 18:24:55 +010023 "var vendor_found = false;",
24 "for (var i = 0; i < jsonData.results.length; i++) { ",
Rene_Robert0ebd04f2019-07-30 17:11:26 +020025 " if (jsonData.results[i].name === pm.globals.get(\"vendor_name\")) {",
Rene Robert53ef77f2019-01-24 18:24:55 +010026 " vendor_found = true;",
Rene_Robert0ebd04f2019-07-30 17:11:26 +020027 " pm.globals.set(\"auto_vendor_id\", \"\"+jsonData.results[i].id+\"\");",
Rene Robert53ef77f2019-01-24 18:24:55 +010028 " }",
29 "}",
30 "if (vendor_found === false) {",
Rene_Robert0ebd04f2019-07-30 17:11:26 +020031 " tests[pm.globals.get(\"vendor_name\")+\" not yet declared\"] = true;",
Rene Robert53ef77f2019-01-24 18:24:55 +010032 "}",
33 "",
34 "else {",
Rene_Robert0ebd04f2019-07-30 17:11:26 +020035 " tests[pm.globals.get(\"vendor_name\")+\" already exists, we stop the run\"] = false;",
Rene Robert53ef77f2019-01-24 18:24:55 +010036 " postman.setNextRequest(null);",
37 "}",
Rene_Robert0ebd04f2019-07-30 17:11:26 +020038 "",
Rene Robert53ef77f2019-01-24 18:24:55 +010039 ""
Rene_Robert0ebd04f2019-07-30 17:11:26 +020040 ],
41 "type": "text/javascript"
Rene Robert53ef77f2019-01-24 18:24:55 +010042 }
43 }
44 ],
45 "request": {
Rene Robert53ef77f2019-01-24 18:24:55 +010046 "method": "GET",
47 "header": [
48 {
49 "key": "Content-Type",
Rene_Robert0ebd04f2019-07-30 17:11:26 +020050 "value": "application/json"
Rene Robert53ef77f2019-01-24 18:24:55 +010051 },
52 {
53 "key": "Accept",
Rene_Robert0ebd04f2019-07-30 17:11:26 +020054 "value": "application/json"
Rene Robert53ef77f2019-01-24 18:24:55 +010055 },
56 {
57 "key": "X-TransactionId",
Rene_Robert0ebd04f2019-07-30 17:11:26 +020058 "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a"
Rene Robert53ef77f2019-01-24 18:24:55 +010059 },
60 {
61 "key": "USER_ID",
Rene_Robert0ebd04f2019-07-30 17:11:26 +020062 "value": "cs0008"
Rene Robert53ef77f2019-01-24 18:24:55 +010063 },
64 {
65 "key": "X-FromAppId",
Rene_Robert0ebd04f2019-07-30 17:11:26 +020066 "value": "robot-ete"
Rene Robert53ef77f2019-01-24 18:24:55 +010067 }
68 ],
69 "body": {
70 "mode": "raw",
Rene_Robert0ebd04f2019-07-30 17:11:26 +020071 "raw": ""
Rene Robert53ef77f2019-01-24 18:24:55 +010072 },
Rene_Robert0ebd04f2019-07-30 17:11:26 +020073 "url": {
74 "raw": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/vendor-license-models",
75 "host": [
76 "{{url-sdc2}}"
77 ],
78 "path": [
79 "sdc1",
80 "feProxy",
81 "onboarding-api",
82 "v1.0",
83 "vendor-license-models"
84 ]
85 }
Rene Robert53ef77f2019-01-24 18:24:55 +010086 },
87 "response": []
88 },
89 {
90 "name": "Create Vendor",
91 "event": [
92 {
93 "listen": "test",
94 "script": {
Rene_Robert0ebd04f2019-07-30 17:11:26 +020095 "id": "80c1d190-d480-4150-ae91-8ce4111c0f9d",
Rene Robert53ef77f2019-01-24 18:24:55 +010096 "exec": [
Rene_Robert0ebd04f2019-07-30 17:11:26 +020097 "pm.test(\"Status code is 200\", function () {",
98 " pm.response.to.have.status(200);",
99 "});",
Rene Robert53ef77f2019-01-24 18:24:55 +0100100 "",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200101 "var jsonData = pm.response.json();",
Rene Robert53ef77f2019-01-24 18:24:55 +0100102 "",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200103 "pm.globals.set(\"auto_vendor_id\", \"\"+jsonData.itemId+\"\");",
104 "pm.globals.set(\"auto_vendor_version_id\", \"\"+jsonData.version.id+\"\");",
105 "",
106 "tests[\"Vendor status is : \"+jsonData.version.status] = jsonData.version.status === \"Draft\";"
107 ],
108 "type": "text/javascript"
Rene Robert53ef77f2019-01-24 18:24:55 +0100109 }
110 }
111 ],
112 "request": {
Rene Robert53ef77f2019-01-24 18:24:55 +0100113 "method": "POST",
114 "header": [
115 {
116 "key": "Content-Type",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200117 "value": "application/json"
Rene Robert53ef77f2019-01-24 18:24:55 +0100118 },
119 {
120 "key": "Accept",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200121 "value": "application/json"
Rene Robert53ef77f2019-01-24 18:24:55 +0100122 },
123 {
124 "key": "X-TransactionId",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200125 "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a"
Rene Robert53ef77f2019-01-24 18:24:55 +0100126 },
127 {
128 "key": "USER_ID",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200129 "value": "cs0008"
Rene Robert53ef77f2019-01-24 18:24:55 +0100130 },
131 {
132 "key": "X-FromAppId",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200133 "value": "robot-ete"
Rene Robert53ef77f2019-01-24 18:24:55 +0100134 }
135 ],
136 "body": {
137 "mode": "raw",
138 "raw": "{\r\n \"iconRef\": \"icon\",\r\n \"vendorName\": \"{{vendor_name}}\",\r\n \"description\": \"Vendor\"\r\n}"
139 },
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200140 "url": {
141 "raw": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/vendor-license-models",
142 "host": [
143 "{{url-sdc2}}"
144 ],
145 "path": [
146 "sdc1",
147 "feProxy",
148 "onboarding-api",
149 "v1.0",
150 "vendor-license-models"
151 ]
152 }
Rene Robert53ef77f2019-01-24 18:24:55 +0100153 },
154 "response": []
155 },
156 {
157 "name": "Get Vendor after create",
158 "event": [
159 {
160 "listen": "test",
161 "script": {
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200162 "id": "aa6fd7c5-c941-43ce-8300-a492c2d62a6c",
Rene Robert53ef77f2019-01-24 18:24:55 +0100163 "exec": [
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200164 "pm.test(\"Status code is 200\", function () {",
165 " pm.response.to.have.status(200);",
166 "});",
Rene Robert53ef77f2019-01-24 18:24:55 +0100167 "",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200168 "var jsonData = pm.response.json();",
169 "",
Rene Robert53ef77f2019-01-24 18:24:55 +0100170 "var vendor_found = false;",
171 "for (var i = 0; i < jsonData.results.length; i++) { ",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200172 " if (jsonData.results[i].name === pm.globals.get(\"vendor_name\")) {",
Rene Robert53ef77f2019-01-24 18:24:55 +0100173 " vendor_found = true;",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200174 " pm.globals.set(\"auto_vendor_id\", \"\"+jsonData.results[i].id+\"\");",
Rene Robert53ef77f2019-01-24 18:24:55 +0100175 " }",
176 "}",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200177 "tests[pm.globals.get(\"vendor_name\")+\" found\"] = vendor_found === vendor_found;",
Rene Robert53ef77f2019-01-24 18:24:55 +0100178 "",
179 "",
180 ""
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200181 ],
182 "type": "text/javascript"
Rene Robert53ef77f2019-01-24 18:24:55 +0100183 }
184 }
185 ],
186 "request": {
Rene Robert53ef77f2019-01-24 18:24:55 +0100187 "method": "GET",
188 "header": [
189 {
190 "key": "Content-Type",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200191 "value": "application/json"
Rene Robert53ef77f2019-01-24 18:24:55 +0100192 },
193 {
194 "key": "Accept",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200195 "value": "application/json"
Rene Robert53ef77f2019-01-24 18:24:55 +0100196 },
197 {
198 "key": "X-TransactionId",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200199 "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a"
Rene Robert53ef77f2019-01-24 18:24:55 +0100200 },
201 {
202 "key": "USER_ID",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200203 "value": "cs0008"
Rene Robert53ef77f2019-01-24 18:24:55 +0100204 },
205 {
206 "key": "X-FromAppId",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200207 "value": "robot-ete"
Rene Robert53ef77f2019-01-24 18:24:55 +0100208 }
209 ],
210 "body": {
211 "mode": "raw",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200212 "raw": ""
Rene Robert53ef77f2019-01-24 18:24:55 +0100213 },
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200214 "url": {
215 "raw": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/vendor-license-models",
216 "host": [
217 "{{url-sdc2}}"
218 ],
219 "path": [
220 "sdc1",
221 "feProxy",
222 "onboarding-api",
223 "v1.0",
224 "vendor-license-models"
225 ]
Rene Robert53ef77f2019-01-24 18:24:55 +0100226 }
Rene Robert53ef77f2019-01-24 18:24:55 +0100227 },
228 "response": []
229 },
230 {
231 "name": "Submit Vendor",
232 "event": [
233 {
234 "listen": "test",
235 "script": {
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200236 "id": "db905800-2754-491a-9d78-1ffebc12fb18",
Rene Robert53ef77f2019-01-24 18:24:55 +0100237 "exec": [
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200238 "pm.test(\"Status code is 200\", function () {",
239 " pm.response.to.have.status(200);",
240 "});",
Rene Robert53ef77f2019-01-24 18:24:55 +0100241 ""
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200242 ],
243 "type": "text/javascript"
Rene Robert53ef77f2019-01-24 18:24:55 +0100244 }
245 }
246 ],
247 "request": {
Rene Robert53ef77f2019-01-24 18:24:55 +0100248 "method": "PUT",
249 "header": [
250 {
251 "key": "Content-Type",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200252 "value": "application/json"
Rene Robert53ef77f2019-01-24 18:24:55 +0100253 },
254 {
255 "key": "Accept",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200256 "value": "application/json"
Rene Robert53ef77f2019-01-24 18:24:55 +0100257 },
258 {
259 "key": "X-TransactionId",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200260 "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a"
Rene Robert53ef77f2019-01-24 18:24:55 +0100261 },
262 {
263 "key": "USER_ID",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200264 "value": "cs0008"
Rene Robert53ef77f2019-01-24 18:24:55 +0100265 },
266 {
267 "key": "X-FromAppId",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200268 "value": "robot-ete"
Rene Robert53ef77f2019-01-24 18:24:55 +0100269 }
270 ],
271 "body": {
272 "mode": "raw",
273 "raw": "{\"action\":\"Submit\"}"
274 },
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200275 "url": {
276 "raw": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/vendor-license-models/{{auto_vendor_id}}/versions/{{auto_vendor_version_id}}/actions",
277 "host": [
278 "{{url-sdc2}}"
279 ],
280 "path": [
281 "sdc1",
282 "feProxy",
283 "onboarding-api",
284 "v1.0",
285 "vendor-license-models",
286 "{{auto_vendor_id}}",
287 "versions",
288 "{{auto_vendor_version_id}}",
289 "actions"
290 ]
Rene Robert53ef77f2019-01-24 18:24:55 +0100291 }
Rene Robert53ef77f2019-01-24 18:24:55 +0100292 },
293 "response": []
294 },
295 {
296 "name": "Get Vendor additional info after Submit",
297 "event": [
298 {
299 "listen": "test",
300 "script": {
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200301 "id": "f9003c80-add1-4581-9a9d-661972f7d6d5",
Rene Robert53ef77f2019-01-24 18:24:55 +0100302 "exec": [
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200303 "pm.test(\"Status code is 200\", function () {",
304 " pm.response.to.have.status(200);",
305 "});",
Rene Robert53ef77f2019-01-24 18:24:55 +0100306 "",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200307 "var jsonData = pm.response.json();",
Rene Robert53ef77f2019-01-24 18:24:55 +0100308 "",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200309 "tests[\"Vendor is : \"+jsonData.status] = jsonData.status === \"Certified\";",
Rene Robert53ef77f2019-01-24 18:24:55 +0100310 ""
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200311 ],
312 "type": "text/javascript"
Rene Robert53ef77f2019-01-24 18:24:55 +0100313 }
314 }
315 ],
316 "request": {
Rene Robert53ef77f2019-01-24 18:24:55 +0100317 "method": "GET",
318 "header": [
319 {
320 "key": "Content-Type",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200321 "value": "application/json"
Rene Robert53ef77f2019-01-24 18:24:55 +0100322 },
323 {
324 "key": "Accept",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200325 "value": "application/json"
Rene Robert53ef77f2019-01-24 18:24:55 +0100326 },
327 {
328 "key": "X-TransactionId",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200329 "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a"
Rene Robert53ef77f2019-01-24 18:24:55 +0100330 },
331 {
332 "key": "USER_ID",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200333 "value": "cs0008"
Rene Robert53ef77f2019-01-24 18:24:55 +0100334 },
335 {
336 "key": "X-FromAppId",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200337 "value": "robot-ete"
Rene Robert53ef77f2019-01-24 18:24:55 +0100338 }
339 ],
340 "body": {
341 "mode": "raw",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200342 "raw": ""
Rene Robert53ef77f2019-01-24 18:24:55 +0100343 },
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200344 "url": {
345 "raw": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/items/{{auto_vendor_id}}/versions/{{auto_vendor_version_id}}",
346 "host": [
347 "{{url-sdc2}}"
348 ],
349 "path": [
350 "sdc1",
351 "feProxy",
352 "onboarding-api",
353 "v1.0",
354 "items",
355 "{{auto_vendor_id}}",
356 "versions",
357 "{{auto_vendor_version_id}}"
358 ]
359 }
Rene Robert53ef77f2019-01-24 18:24:55 +0100360 },
361 "response": []
362 }
363 ]
364}