blob: 17d23d320a0e1b7d6711f80a7ef8c69f517873b6 [file] [log] [blame]
Rene Robert53ef77f2019-01-24 18:24:55 +01001{
Rene Robert53ef77f2019-01-24 18:24:55 +01002 "info": {
Rene_Robert11c57832019-10-22 17:27:21 +02003 "_postman_id": "338c7225-c4d5-40c8-8619-ae904f41a83d",
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_Robert11c57832019-10-22 17:27:21 +020025 " if (jsonData.results[i].name === pm.environment.get(\"vendor_name\")) {",
Rene Robert53ef77f2019-01-24 18:24:55 +010026 " vendor_found = true;",
Rene_Robert11c57832019-10-22 17:27:21 +020027 " pm.environment.set(\"auto_vendor_id\", \"\"+jsonData.results[i].id+\"\");",
Rene Robert53ef77f2019-01-24 18:24:55 +010028 " }",
29 "}",
30 "if (vendor_found === false) {",
Rene_Robert11c57832019-10-22 17:27:21 +020031 " tests[pm.environment.get(\"vendor_name\")+\" not yet declared\"] = true;",
Rene Robert53ef77f2019-01-24 18:24:55 +010032 "}",
33 "",
34 "else {",
Rene_Robert11c57832019-10-22 17:27:21 +020035 " tests[pm.environment.get(\"vendor_name\")+\" already exists, we stop the run\"] = false;",
Rene Robert53ef77f2019-01-24 18:24:55 +010036 " postman.setNextRequest(null);",
37 "}",
38 ""
Rene_Robert0ebd04f2019-07-30 17:11:26 +020039 ],
40 "type": "text/javascript"
Rene Robert53ef77f2019-01-24 18:24:55 +010041 }
42 }
43 ],
44 "request": {
Rene Robert53ef77f2019-01-24 18:24:55 +010045 "method": "GET",
46 "header": [
47 {
48 "key": "Content-Type",
Rene_Robert0ebd04f2019-07-30 17:11:26 +020049 "value": "application/json"
Rene Robert53ef77f2019-01-24 18:24:55 +010050 },
51 {
52 "key": "Accept",
Rene_Robert0ebd04f2019-07-30 17:11:26 +020053 "value": "application/json"
Rene Robert53ef77f2019-01-24 18:24:55 +010054 },
55 {
56 "key": "X-TransactionId",
Rene_Robert0ebd04f2019-07-30 17:11:26 +020057 "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a"
Rene Robert53ef77f2019-01-24 18:24:55 +010058 },
59 {
60 "key": "USER_ID",
Rene_Robert0ebd04f2019-07-30 17:11:26 +020061 "value": "cs0008"
Rene Robert53ef77f2019-01-24 18:24:55 +010062 },
63 {
64 "key": "X-FromAppId",
Rene_Robert0ebd04f2019-07-30 17:11:26 +020065 "value": "robot-ete"
Rene Robert53ef77f2019-01-24 18:24:55 +010066 }
67 ],
68 "body": {
69 "mode": "raw",
Rene_Robert0ebd04f2019-07-30 17:11:26 +020070 "raw": ""
Rene Robert53ef77f2019-01-24 18:24:55 +010071 },
Rene_Robert0ebd04f2019-07-30 17:11:26 +020072 "url": {
73 "raw": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/vendor-license-models",
74 "host": [
75 "{{url-sdc2}}"
76 ],
77 "path": [
78 "sdc1",
79 "feProxy",
80 "onboarding-api",
81 "v1.0",
82 "vendor-license-models"
83 ]
84 }
Rene Robert53ef77f2019-01-24 18:24:55 +010085 },
86 "response": []
87 },
88 {
89 "name": "Create Vendor",
90 "event": [
91 {
92 "listen": "test",
93 "script": {
Rene_Robert0ebd04f2019-07-30 17:11:26 +020094 "id": "80c1d190-d480-4150-ae91-8ce4111c0f9d",
Rene Robert53ef77f2019-01-24 18:24:55 +010095 "exec": [
Rene_Robert0ebd04f2019-07-30 17:11:26 +020096 "pm.test(\"Status code is 200\", function () {",
97 " pm.response.to.have.status(200);",
98 "});",
Rene Robert53ef77f2019-01-24 18:24:55 +010099 "",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200100 "var jsonData = pm.response.json();",
Rene Robert53ef77f2019-01-24 18:24:55 +0100101 "",
Rene_Robert11c57832019-10-22 17:27:21 +0200102 "pm.environment.set(\"auto_vendor_id\", \"\"+jsonData.itemId+\"\");",
103 "pm.environment.set(\"auto_vendor_version_id\", \"\"+jsonData.version.id+\"\");",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200104 "",
105 "tests[\"Vendor status is : \"+jsonData.version.status] = jsonData.version.status === \"Draft\";"
106 ],
107 "type": "text/javascript"
Rene Robert53ef77f2019-01-24 18:24:55 +0100108 }
109 }
110 ],
111 "request": {
Rene Robert53ef77f2019-01-24 18:24:55 +0100112 "method": "POST",
113 "header": [
114 {
115 "key": "Content-Type",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200116 "value": "application/json"
Rene Robert53ef77f2019-01-24 18:24:55 +0100117 },
118 {
119 "key": "Accept",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200120 "value": "application/json"
Rene Robert53ef77f2019-01-24 18:24:55 +0100121 },
122 {
123 "key": "X-TransactionId",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200124 "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a"
Rene Robert53ef77f2019-01-24 18:24:55 +0100125 },
126 {
127 "key": "USER_ID",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200128 "value": "cs0008"
Rene Robert53ef77f2019-01-24 18:24:55 +0100129 },
130 {
131 "key": "X-FromAppId",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200132 "value": "robot-ete"
Rene Robert53ef77f2019-01-24 18:24:55 +0100133 }
134 ],
135 "body": {
136 "mode": "raw",
137 "raw": "{\r\n \"iconRef\": \"icon\",\r\n \"vendorName\": \"{{vendor_name}}\",\r\n \"description\": \"Vendor\"\r\n}"
138 },
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200139 "url": {
140 "raw": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/vendor-license-models",
141 "host": [
142 "{{url-sdc2}}"
143 ],
144 "path": [
145 "sdc1",
146 "feProxy",
147 "onboarding-api",
148 "v1.0",
149 "vendor-license-models"
150 ]
151 }
Rene Robert53ef77f2019-01-24 18:24:55 +0100152 },
153 "response": []
154 },
155 {
156 "name": "Get Vendor after create",
157 "event": [
158 {
159 "listen": "test",
160 "script": {
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200161 "id": "aa6fd7c5-c941-43ce-8300-a492c2d62a6c",
Rene Robert53ef77f2019-01-24 18:24:55 +0100162 "exec": [
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200163 "pm.test(\"Status code is 200\", function () {",
164 " pm.response.to.have.status(200);",
165 "});",
Rene Robert53ef77f2019-01-24 18:24:55 +0100166 "",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200167 "var jsonData = pm.response.json();",
168 "",
Rene Robert53ef77f2019-01-24 18:24:55 +0100169 "var vendor_found = false;",
170 "for (var i = 0; i < jsonData.results.length; i++) { ",
Rene_Robert11c57832019-10-22 17:27:21 +0200171 " if (jsonData.results[i].name === pm.environment.get(\"vendor_name\")) {",
Rene Robert53ef77f2019-01-24 18:24:55 +0100172 " vendor_found = true;",
Rene_Robert11c57832019-10-22 17:27:21 +0200173 " pm.environment.set(\"auto_vendor_id\", \"\"+jsonData.results[i].id+\"\");",
Rene Robert53ef77f2019-01-24 18:24:55 +0100174 " }",
175 "}",
Rene_Robert11c57832019-10-22 17:27:21 +0200176 "tests[pm.environment.get(\"vendor_name\")+\" found\"] = vendor_found === vendor_found;",
Rene Robert53ef77f2019-01-24 18:24:55 +0100177 "",
178 "",
179 ""
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200180 ],
181 "type": "text/javascript"
Rene Robert53ef77f2019-01-24 18:24:55 +0100182 }
183 }
184 ],
185 "request": {
Rene Robert53ef77f2019-01-24 18:24:55 +0100186 "method": "GET",
187 "header": [
188 {
189 "key": "Content-Type",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200190 "value": "application/json"
Rene Robert53ef77f2019-01-24 18:24:55 +0100191 },
192 {
193 "key": "Accept",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200194 "value": "application/json"
Rene Robert53ef77f2019-01-24 18:24:55 +0100195 },
196 {
197 "key": "X-TransactionId",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200198 "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a"
Rene Robert53ef77f2019-01-24 18:24:55 +0100199 },
200 {
201 "key": "USER_ID",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200202 "value": "cs0008"
Rene Robert53ef77f2019-01-24 18:24:55 +0100203 },
204 {
205 "key": "X-FromAppId",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200206 "value": "robot-ete"
Rene Robert53ef77f2019-01-24 18:24:55 +0100207 }
208 ],
209 "body": {
210 "mode": "raw",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200211 "raw": ""
Rene Robert53ef77f2019-01-24 18:24:55 +0100212 },
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200213 "url": {
214 "raw": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/vendor-license-models",
215 "host": [
216 "{{url-sdc2}}"
217 ],
218 "path": [
219 "sdc1",
220 "feProxy",
221 "onboarding-api",
222 "v1.0",
223 "vendor-license-models"
224 ]
Rene Robert53ef77f2019-01-24 18:24:55 +0100225 }
Rene Robert53ef77f2019-01-24 18:24:55 +0100226 },
227 "response": []
228 },
229 {
230 "name": "Submit Vendor",
231 "event": [
232 {
233 "listen": "test",
234 "script": {
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200235 "id": "db905800-2754-491a-9d78-1ffebc12fb18",
Rene Robert53ef77f2019-01-24 18:24:55 +0100236 "exec": [
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200237 "pm.test(\"Status code is 200\", function () {",
238 " pm.response.to.have.status(200);",
239 "});",
Rene Robert53ef77f2019-01-24 18:24:55 +0100240 ""
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200241 ],
242 "type": "text/javascript"
Rene Robert53ef77f2019-01-24 18:24:55 +0100243 }
244 }
245 ],
246 "request": {
Rene Robert53ef77f2019-01-24 18:24:55 +0100247 "method": "PUT",
248 "header": [
249 {
250 "key": "Content-Type",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200251 "value": "application/json"
Rene Robert53ef77f2019-01-24 18:24:55 +0100252 },
253 {
254 "key": "Accept",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200255 "value": "application/json"
Rene Robert53ef77f2019-01-24 18:24:55 +0100256 },
257 {
258 "key": "X-TransactionId",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200259 "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a"
Rene Robert53ef77f2019-01-24 18:24:55 +0100260 },
261 {
262 "key": "USER_ID",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200263 "value": "cs0008"
Rene Robert53ef77f2019-01-24 18:24:55 +0100264 },
265 {
266 "key": "X-FromAppId",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200267 "value": "robot-ete"
Rene Robert53ef77f2019-01-24 18:24:55 +0100268 }
269 ],
270 "body": {
271 "mode": "raw",
272 "raw": "{\"action\":\"Submit\"}"
273 },
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200274 "url": {
275 "raw": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/vendor-license-models/{{auto_vendor_id}}/versions/{{auto_vendor_version_id}}/actions",
276 "host": [
277 "{{url-sdc2}}"
278 ],
279 "path": [
280 "sdc1",
281 "feProxy",
282 "onboarding-api",
283 "v1.0",
284 "vendor-license-models",
285 "{{auto_vendor_id}}",
286 "versions",
287 "{{auto_vendor_version_id}}",
288 "actions"
289 ]
Rene Robert53ef77f2019-01-24 18:24:55 +0100290 }
Rene Robert53ef77f2019-01-24 18:24:55 +0100291 },
292 "response": []
293 },
294 {
295 "name": "Get Vendor additional info after Submit",
296 "event": [
297 {
298 "listen": "test",
299 "script": {
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200300 "id": "f9003c80-add1-4581-9a9d-661972f7d6d5",
Rene Robert53ef77f2019-01-24 18:24:55 +0100301 "exec": [
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200302 "pm.test(\"Status code is 200\", function () {",
303 " pm.response.to.have.status(200);",
304 "});",
Rene Robert53ef77f2019-01-24 18:24:55 +0100305 "",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200306 "var jsonData = pm.response.json();",
Rene Robert53ef77f2019-01-24 18:24:55 +0100307 "",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200308 "tests[\"Vendor is : \"+jsonData.status] = jsonData.status === \"Certified\";",
Rene Robert53ef77f2019-01-24 18:24:55 +0100309 ""
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200310 ],
311 "type": "text/javascript"
Rene Robert53ef77f2019-01-24 18:24:55 +0100312 }
313 }
314 ],
315 "request": {
Rene Robert53ef77f2019-01-24 18:24:55 +0100316 "method": "GET",
317 "header": [
318 {
319 "key": "Content-Type",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200320 "value": "application/json"
Rene Robert53ef77f2019-01-24 18:24:55 +0100321 },
322 {
323 "key": "Accept",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200324 "value": "application/json"
Rene Robert53ef77f2019-01-24 18:24:55 +0100325 },
326 {
327 "key": "X-TransactionId",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200328 "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a"
Rene Robert53ef77f2019-01-24 18:24:55 +0100329 },
330 {
331 "key": "USER_ID",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200332 "value": "cs0008"
Rene Robert53ef77f2019-01-24 18:24:55 +0100333 },
334 {
335 "key": "X-FromAppId",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200336 "value": "robot-ete"
Rene Robert53ef77f2019-01-24 18:24:55 +0100337 }
338 ],
339 "body": {
340 "mode": "raw",
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200341 "raw": ""
Rene Robert53ef77f2019-01-24 18:24:55 +0100342 },
Rene_Robert0ebd04f2019-07-30 17:11:26 +0200343 "url": {
344 "raw": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/items/{{auto_vendor_id}}/versions/{{auto_vendor_version_id}}",
345 "host": [
346 "{{url-sdc2}}"
347 ],
348 "path": [
349 "sdc1",
350 "feProxy",
351 "onboarding-api",
352 "v1.0",
353 "items",
354 "{{auto_vendor_id}}",
355 "versions",
356 "{{auto_vendor_version_id}}"
357 ]
358 }
Rene Robert53ef77f2019-01-24 18:24:55 +0100359 },
360 "response": []
361 }
362 ]
363}