Issue-ID: INT-1178
[integration.git] / test / postman / 02_Onboard_VSP_part1.postman_collection.json
index 207d35a..557b557 100644 (file)
@@ -1,10 +1,8 @@
 {
-       "variables": [],
        "info": {
+               "_postman_id": "e226e82c-74b6-42bc-a1e9-1168b860a234",
                "name": "02_Onboard_VSP_part1",
-               "_postman_id": "8c958074-e35a-6ae9-4ce4-2133b11d72b0",
-               "description": "",
-               "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
+               "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
        },
        "item": [
                {
                                {
                                        "listen": "test",
                                        "script": {
-                                               "type": "text/javascript",
+                                               "id": "dc866867-2909-4844-9072-01c9e2e4e856",
                                                "exec": [
-                                                       "tests[\"Status code is 200\"] = responseCode.code === 200;",
+                                                       "pm.test(\"Status code is 200\", function () {",
+                                                       "    pm.response.to.have.status(200);",
+                                                       "});",
                                                        "",
-                                                       "var jsonData = JSON.parse(responseBody);",
+                                                       "var jsonData = pm.response.json();",
                                                        "var vsp_found = false;",
-                                                       "for (var i = 0; i < jsonData['results'].length; i++) { ",
-                                                       "   if (jsonData['results'][i].name === postman.getGlobalVariable(\"vsp_name\")) {",
+                                                       "for (var i = 0; i < jsonData.results.length; i++) { ",
+                                                       "   if (jsonData.results[i].name === pm.globals.get(\"vsp_name\")) {",
                                                        "       vsp_found = true;",
                                                        "   }",
                                                        "}",
                                                        "",
                                                        "if (vsp_found === false) {",
-                                                       "    tests[postman.getGlobalVariable(\"vsp_name\")+\" does not exists, we continue\"] = true;",
+                                                       "    tests[pm.globals.get(\"vsp_name\")+\" does not yet exist, we continue\"] = true;",
                                                        "}",
                                                        "",
                                                        "else {",
-                                                       "    tests[postman.getGlobalVariable(\"vsp_name\")+\" already exists, we stop the run\"] = true;",
+                                                       "    tests[pm.globals.get(\"vsp_name\")+\" already exists, we stop the run\"] = false;",
                                                        "    postman.setNextRequest(null);",
                                                        "}"
-                                               ]
+                                               ],
+                                               "type": "text/javascript"
                                        }
                                }
                        ],
                        "request": {
-                               "url": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products",
                                "method": "GET",
                                "header": [
                                        {
                                                "key": "Content-Type",
-                                               "value": "application/json",
-                                               "description": ""
+                                               "value": "application/json"
                                        },
                                        {
                                                "key": "Accept",
-                                               "value": "application/json",
-                                               "description": ""
+                                               "value": "application/json"
                                        },
                                        {
                                                "key": "X-TransactionId",
-                                               "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a",
-                                               "description": ""
+                                               "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a"
                                        },
                                        {
                                                "key": "USER_ID",
-                                               "value": "cs0008",
-                                               "description": ""
+                                               "value": "cs0008"
                                        },
                                        {
                                                "key": "X-FromAppId",
-                                               "value": "robot-ete",
-                                               "description": ""
+                                               "value": "robot-ete"
                                        }
                                ],
                                "body": {
                                        "mode": "raw",
-                                       "raw": "{\"category\": \"resourceNewCategory.generic\", \"vendorId\": \"CE00625F0B334F7FBD7294293956649E\", \"subCategory\": \"resourceNewCategory.generic.abstract\", \"description\": \"vendor software product\", \"licensingVersion\": \"1.0\", \"licensingData\": {\"featureGroups\": [\"74F4A12BA9B5461CAF69C17AB4301889\"], \"licenseAgreement\": \"D738E60042A14FE0914B375F3FAE1BC8\"}, \"icon\": \"icon\", \"vendorName\": \"test-api-license-model\", \"name\": \"test-vsp\"}"
+                                       "raw": ""
                                },
-                               "description": ""
+                               "url": {
+                                       "raw": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products",
+                                       "host": [
+                                               "{{url-sdc2}}"
+                                       ],
+                                       "path": [
+                                               "sdc1",
+                                               "feProxy",
+                                               "onboarding-api",
+                                               "v1.0",
+                                               "vendor-software-products"
+                                       ]
+                               }
                        },
                        "response": []
                },
                                {
                                        "listen": "test",
                                        "script": {
-                                               "type": "text/javascript",
+                                               "id": "dbd0ea7f-5f66-4431-8a51-2e5d757647a0",
                                                "exec": [
-                                                       "tests[\"Status code is 200\"] = responseCode.code === 200;",
+                                                       "pm.test(\"Status code is 200\", function () {",
+                                                       "    pm.response.to.have.status(200);",
+                                                       "});",
+                                                       "",
                                                        "",
-                                                       "var jsonData = JSON.parse(responseBody);",
+                                                       "var jsonData = pm.response.json();",
                                                        "var vendor_found = false;",
                                                        "for (var i = 0; i < jsonData.results.length; i++) { ",
-                                                       "   if (jsonData.results[i][\"name\"] === postman.getGlobalVariable(\"vendor_name\")) {",
+                                                       "   if (jsonData.results[i].name === pm.globals.get(\"vendor_name\")) {",
                                                        "       vendor_found = true;",
-                                                       "       postman.setGlobalVariable(\"auto_vendor_id\", \"\"+jsonData.results[i][\"id\"]+\"\");",
+                                                       "       pm.globals.set(\"auto_vendor_id\", \"\"+jsonData.results[i].id+\"\");",
                                                        "   }",
                                                        "}",
                                                        "if (vendor_found === false) {",
-                                                       "    tests[postman.getGlobalVariable(\"vendor_name\")+\" does not exists : we stop the run\"] = false;",
+                                                       "    tests[pm.globals.get(\"vendor_name\")+\" does not exists : we stop the run\"] = false;",
                                                        "    postman.setNextRequest(null);",
                                                        "}",
                                                        "",
                                                        "else {",
-                                                       "    tests[postman.getGlobalVariable(\"vendor_name\")+\" exists\"] = true;",
+                                                       "    tests[pm.globals.get(\"vendor_name\")+\" exists\"] = true;",
                                                        "}",
                                                        "",
                                                        "",
                                                        ""
-                                               ]
+                                               ],
+                                               "type": "text/javascript"
                                        }
                                }
                        ],
                        "request": {
-                               "url": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/vendor-license-models",
                                "method": "GET",
                                "header": [
                                        {
                                                "key": "Content-Type",
-                                               "value": "application/json",
-                                               "description": ""
+                                               "value": "application/json"
                                        },
                                        {
                                                "key": "Accept",
-                                               "value": "application/json",
-                                               "description": ""
+                                               "value": "application/json"
                                        },
                                        {
                                                "key": "X-TransactionId",
-                                               "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a",
-                                               "description": ""
+                                               "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a"
                                        },
                                        {
                                                "key": "USER_ID",
-                                               "value": "cs0008",
-                                               "description": ""
+                                               "value": "cs0008"
                                        },
                                        {
                                                "key": "X-FromAppId",
-                                               "value": "robot-ete",
-                                               "description": ""
+                                               "value": "robot-ete"
                                        }
                                ],
                                "body": {
                                        "mode": "raw",
-                                       "raw": "{\"iconRef\": \"icon\", \"vendorName\": \"test-api-license-model\", \"description\": \"vendor license model\"}"
+                                       "raw": ""
                                },
-                               "description": ""
+                               "url": {
+                                       "raw": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/vendor-license-models",
+                                       "host": [
+                                               "{{url-sdc2}}"
+                                       ],
+                                       "path": [
+                                               "sdc1",
+                                               "feProxy",
+                                               "onboarding-api",
+                                               "v1.0",
+                                               "vendor-license-models"
+                                       ]
+                               }
                        },
                        "response": []
                },
                                {
                                        "listen": "test",
                                        "script": {
-                                               "type": "text/javascript",
+                                               "id": "739f040c-f4b1-4790-bfce-4f5dae60b637",
                                                "exec": [
-                                                       "tests[\"Status code is 200\"] = responseCode.code === 200;",
+                                                       "pm.test(\"Status code is 200\", function () {",
+                                                       "    pm.response.to.have.status(200);",
+                                                       "});",
                                                        "",
-                                                       "var jsonData = JSON.parse(responseBody);",
-                                                       "postman.setGlobalVariable(\"auto_vsp_id\", \"\"+jsonData[\"itemId\"]+\"\");",
-                                                       "postman.setGlobalVariable(\"auto_vsp_version_id\", \"\"+jsonData[\"version\"][\"id\"]+\"\");",
-                                                       "postman.setGlobalVariable(\"auto_vsp_version_name\", \"\"+jsonData[\"version\"][\"name\"]+\"\");",
+                                                       "var jsonData = pm.response.json();",
+                                                       "pm.globals.set(\"auto_vsp_id\", \"\"+jsonData.itemId+\"\");",
+                                                       "pm.globals.set(\"auto_vsp_version_id\", \"\"+jsonData.version.id+\"\");",
+                                                       "pm.globals.set(\"auto_vsp_version_name\", \"\"+jsonData.version.name+\"\");",
                                                        "",
-                                                       "tests[\"Vendor version is in Draft status\"] = jsonData[\"version\"][\"status\"] === \"Draft\";"
-                                               ]
+                                                       "tests[\"VSP version is : \"+jsonData.version.status] = jsonData.version.status === \"Draft\";"
+                                               ],
+                                               "type": "text/javascript"
                                        }
                                }
                        ],
                        "request": {
-                               "url": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products",
                                "method": "POST",
                                "header": [
                                        {
                                                "key": "Content-Type",
-                                               "value": "application/json",
-                                               "description": ""
+                                               "value": "application/json"
                                        },
                                        {
                                                "key": "Accept",
-                                               "value": "application/json",
-                                               "description": ""
+                                               "value": "application/json"
                                        },
                                        {
                                                "key": "X-TransactionId",
-                                               "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a",
-                                               "description": ""
+                                               "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a"
                                        },
                                        {
                                                "key": "USER_ID",
-                                               "value": "cs0008",
-                                               "description": ""
+                                               "value": "cs0008"
                                        },
                                        {
                                                "key": "X-FromAppId",
-                                               "value": "robot-ete",
-                                               "description": ""
+                                               "value": "robot-ete"
                                        }
                                ],
                                "body": {
                                        "mode": "raw",
                                        "raw": "{\r\n  \"name\": \"{{vsp_name}}\",\r\n  \"description\": \"vendor software product\",\r\n  \"icon\": \"icon\",\r\n  \"category\": \"resourceNewCategory.generic\",\r\n  \"subCategory\": \"resourceNewCategory.generic.abstract\",\r\n  \"vendorName\": \"{{vendor_name}}\",\r\n  \"vendorId\": \"{{auto_vendor_id}}\",\r\n  \"licensingData\": {},\r\n  \"onboardingMethod\": \"NetworkPackage\"\r\n}"
                                },
-                               "description": ""
+                               "url": {
+                                       "raw": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products",
+                                       "host": [
+                                               "{{url-sdc2}}"
+                                       ],
+                                       "path": [
+                                               "sdc1",
+                                               "feProxy",
+                                               "onboarding-api",
+                                               "v1.0",
+                                               "vendor-software-products"
+                                       ]
+                               }
                        },
                        "response": [
                                {
-                                       "id": "ca88aaf4-ec1b-4d75-8834-85c628a10c50",
                                        "name": "Create Vendor Software Product",
                                        "originalRequest": {
-                                               "url": "",
+                                               "method": "GET",
                                                "header": [],
                                                "body": {
                                                        "mode": "raw",
                                                        "raw": ""
                                                },
-                                               "description": ""
+                                               "url": {
+                                                       "raw": ""
+                                               }
                                        },
                                        "status": "OK",
                                        "code": 200,
                                        "_postman_previewlanguage": "json",
-                                       "_postman_previewtype": "text",
                                        "header": [
                                                {
-                                                       "name": "access-control-allow-credentials",
                                                        "key": "access-control-allow-credentials",
                                                        "value": "true",
+                                                       "name": "access-control-allow-credentials",
                                                        "description": "Indicates whether or not the response to the request can be exposed when the credentials flag is true. When used as part of a response to a preflight request, this indicates whether or not the actual request can be made using credentials."
                                                },
                                                {
-                                                       "name": "access-control-allow-origin",
                                                        "key": "access-control-allow-origin",
                                                        "value": "chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop",
+                                                       "name": "access-control-allow-origin",
                                                        "description": "Specifies a URI that may access the resource. For requests without credentials, the server may specify '*' as a wildcard, thereby allowing any origin to access the resource."
                                                },
                                                {
-                                                       "name": "access-control-expose-headers",
                                                        "key": "access-control-expose-headers",
                                                        "value": "",
+                                                       "name": "access-control-expose-headers",
                                                        "description": "Lets a server whitelist headers that browsers are allowed to access."
                                                },
                                                {
-                                                       "name": "content-type",
                                                        "key": "content-type",
                                                        "value": "application/json",
+                                                       "name": "content-type",
                                                        "description": "The mime type of this content"
                                                },
                                                {
-                                                       "name": "date",
                                                        "key": "date",
                                                        "value": "Wed, 06 Jun 2018 15:02:46 GMT",
+                                                       "name": "date",
                                                        "description": "The date and time that the message was sent"
                                                },
                                                {
-                                                       "name": "server",
                                                        "key": "server",
                                                        "value": "Jetty(9.3.21.v20170918)",
+                                                       "name": "server",
                                                        "description": "A name for the server"
                                                },
                                                {
-                                                       "name": "transfer-encoding",
                                                        "key": "transfer-encoding",
                                                        "value": "chunked",
+                                                       "name": "transfer-encoding",
                                                        "description": "The form of encoding used to safely transfer the entity to the user. Currently defined methods are: chunked, compress, deflate, gzip, identity."
                                                }
                                        ],
                                        "cookie": [],
-                                       "responseTime": 82,
                                        "body": "{\"vspId\":\"b3267b0aefbd4e2ea52be0e414139b1c\"}"
                                }
                        ]
                                {
                                        "listen": "test",
                                        "script": {
-                                               "type": "text/javascript",
+                                               "id": "5e55115d-c797-4b34-bfaf-d2af24d62c01",
                                                "exec": [
-                                                       "tests[\"Status code is 200\"] = responseCode.code === 200;"
-                                               ]
+                                                       "pm.test(\"Status code is 200\", function () {",
+                                                       "    pm.response.to.have.status(200);",
+                                                       "});"
+                                               ],
+                                               "type": "text/javascript"
                                        }
                                }
                        ],
                        "request": {
-                               "url": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/items/{{auto_vsp_id}}/versions",
                                "method": "GET",
                                "header": [
                                        {
                                                "key": "Content-Type",
-                                               "value": "application/json",
-                                               "description": ""
+                                               "value": "application/json"
                                        },
                                        {
                                                "key": "Accept",
-                                               "value": "application/json",
-                                               "description": ""
+                                               "value": "application/json"
                                        },
                                        {
                                                "key": "X-TransactionId",
-                                               "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a",
-                                               "description": ""
+                                               "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a"
                                        },
                                        {
                                                "key": "USER_ID",
-                                               "value": "cs0008",
-                                               "description": ""
+                                               "value": "cs0008"
                                        },
                                        {
                                                "key": "X-FromAppId",
-                                               "value": "robot-ete",
-                                               "description": ""
+                                               "value": "robot-ete"
                                        }
                                ],
                                "body": {
                                        "mode": "raw",
-                                       "raw": "{\"category\": \"resourceNewCategory.generic\", \"vendorId\": \"CE00625F0B334F7FBD7294293956649E\", \"subCategory\": \"resourceNewCategory.generic.abstract\", \"description\": \"vendor software product\", \"licensingVersion\": \"1.0\", \"licensingData\": {\"featureGroups\": [\"74F4A12BA9B5461CAF69C17AB4301889\"], \"licenseAgreement\": \"D738E60042A14FE0914B375F3FAE1BC8\"}, \"icon\": \"icon\", \"vendorName\": \"test-api-license-model\", \"name\": \"test-vsp\"}"
+                                       "raw": ""
                                },
-                               "description": ""
+                               "url": {
+                                       "raw": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/items/{{auto_vsp_id}}/versions",
+                                       "host": [
+                                               "{{url-sdc2}}"
+                                       ],
+                                       "path": [
+                                               "sdc1",
+                                               "feProxy",
+                                               "onboarding-api",
+                                               "v1.0",
+                                               "items",
+                                               "{{auto_vsp_id}}",
+                                               "versions"
+                                       ]
+                               }
                        },
                        "response": []
                },
                                {
                                        "listen": "test",
                                        "script": {
-                                               "type": "text/javascript",
+                                               "id": "2492d06b-4b31-4d93-aaf2-3417419c6e14",
                                                "exec": [
-                                                       "tests[\"Status code is 200\"] = responseCode.code === 200;"
-                                               ]
+                                                       "pm.test(\"Status code is 200\", function () {",
+                                                       "    pm.response.to.have.status(200);",
+                                                       "});",
+                                                       ""
+                                               ],
+                                               "type": "text/javascript"
                                        }
                                }
                        ],
                        "request": {
-                               "url": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/items/{{auto_vsp_id}}/versions/{{auto_vsp_version_id}}",
                                "method": "GET",
                                "header": [
                                        {
                                                "key": "Content-Type",
-                                               "value": "application/json",
-                                               "description": ""
+                                               "value": "application/json"
                                        },
                                        {
                                                "key": "Accept",
-                                               "value": "application/json",
-                                               "description": ""
+                                               "value": "application/json"
                                        },
                                        {
                                                "key": "X-TransactionId",
-                                               "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a",
-                                               "description": ""
+                                               "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a"
                                        },
                                        {
                                                "key": "USER_ID",
-                                               "value": "cs0008",
-                                               "description": ""
+                                               "value": "cs0008"
                                        },
                                        {
                                                "key": "X-FromAppId",
-                                               "value": "robot-ete",
-                                               "description": ""
+                                               "value": "robot-ete"
                                        }
                                ],
                                "body": {
                                        "mode": "raw",
-                                       "raw": "{\"category\": \"resourceNewCategory.generic\", \"vendorId\": \"CE00625F0B334F7FBD7294293956649E\", \"subCategory\": \"resourceNewCategory.generic.abstract\", \"description\": \"vendor software product\", \"licensingVersion\": \"1.0\", \"licensingData\": {\"featureGroups\": [\"74F4A12BA9B5461CAF69C17AB4301889\"], \"licenseAgreement\": \"D738E60042A14FE0914B375F3FAE1BC8\"}, \"icon\": \"icon\", \"vendorName\": \"test-api-license-model\", \"name\": \"test-vsp\"}"
+                                       "raw": ""
                                },
-                               "description": ""
+                               "url": {
+                                       "raw": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/items/{{auto_vsp_id}}/versions/{{auto_vsp_version_id}}",
+                                       "host": [
+                                               "{{url-sdc2}}"
+                                       ],
+                                       "path": [
+                                               "sdc1",
+                                               "feProxy",
+                                               "onboarding-api",
+                                               "v1.0",
+                                               "items",
+                                               "{{auto_vsp_id}}",
+                                               "versions",
+                                               "{{auto_vsp_version_id}}"
+                                       ]
+                               }
                        },
                        "response": []
                }