{ "info": { "_postman_id": "0c9cdab7-0764-42b8-a9d1-a11945d7af2a", "name": "uniform-connector", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "uniform-exchange", "item": [ { "name": "settings esb", "item": [ { "name": "Create profile system1", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", "pm.test(\"Body matches true\", function () {", " pm.expect(pm.response.text()).to.include(\"true\");", "});", "", "function getSoapBody() {", " var jsonObject = xml2Json(responseBody);", " return jsonObject['soap:Envelope']['soap:Body'];", "}", "", "pm.test(\"Response is true\", function () {", " var response = getSoapBody();", " pm.expect(response.response._).to.eql('true');", "});" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "password", "value": "{{adminPassword}}", "type": "string" }, { "key": "username", "value": "{{adminLogin}}", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/xml", "type": "text" } ], "body": { "mode": "raw", "raw": "\n \n \n \n {{system1_id}}\n {{system1_id}}\n \n description1\n \n \n", "options": { "raw": { "language": "xml" } } }, "url": { "raw": "{{base_url}}/system-management", "host": [ "{{base_url}}" ], "path": [ "system-management" ] } }, "response": [] }, { "name": "Create profile system2", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", "pm.test(\"Body matches true\", function () {", " pm.expect(pm.response.text()).to.include(\"true\");", "});", "", "function getSoapBody() {", " var jsonObject = xml2Json(responseBody);", " return jsonObject['soap:Envelope']['soap:Body'];", "}", "", "pm.test(\"Response is true\", function () {", " var response = getSoapBody();", " pm.expect(response.response._).to.eql('true');", "});" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "password", "value": "{{adminPassword}}", "type": "string" }, { "key": "username", "value": "{{adminLogin}}", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/xml", "type": "text" } ], "body": { "mode": "raw", "raw": "\n \n \n \n {{system2_id}}\n {{system2_id}}\n \n description2\n \n \n", "options": { "raw": { "language": "xml" } } }, "url": { "raw": "{{base_url}}/system-management", "host": [ "{{base_url}}" ], "path": [ "system-management" ] } }, "response": [] }, { "name": "Add Account system1", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", "pm.test(\"Body matches true\", function () {", " pm.expect(pm.response.text()).to.include(\"true\");", "});", "", "function getSoapBody() {", " var soapBody = responseBody.match(//g);", " var jsonObject = xml2Json(soapBody);", " return jsonObject['soap:Envelope']['soap:Body'];", "}", "", "pm.test(\"Response is true\", function () {", " var response = getSoapBody();", " pm.expect(response.response._).to.eql('true');", "});" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "password", "value": "{{adminPassword}}", "type": "string" }, { "key": "username", "value": "{{adminLogin}}", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/xml", "type": "text" } ], "body": { "mode": "raw", "raw": "\n \n \n \n \n \n {{system1Login}}\n {{system1Password}}\n \n {{system1_id}}\n \n {{system1_id}}\n \n \n \n", "options": { "raw": { "language": "xml" } } }, "url": { "raw": "{{base_url}}/basic-auth-management", "host": [ "{{base_url}}" ], "path": [ "basic-auth-management" ] } }, "response": [] }, { "name": "Add Account system2", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", "pm.test(\"Body matches true\", function () {", " pm.expect(pm.response.text()).to.include(\"true\");", "});", "", "function getSoapBody() {", " var soapBody = responseBody.match(//g);", " var jsonObject = xml2Json(soapBody);", " return jsonObject['soap:Envelope']['soap:Body'];", "}", "", "pm.test(\"Response is true\", function () {", " var response = getSoapBody();", " pm.expect(response.response._).to.eql('true');", "});" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "password", "value": "{{adminPassword}}", "type": "string" }, { "key": "username", "value": "{{adminLogin}}", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/xml", "type": "text" } ], "body": { "mode": "raw", "raw": "\n \n \n \n \n \n {{system2Login}}\n {{system2Password}}\n \n {{system2_id}}\n \n {{system2_id}}\n \n \n \n", "options": { "raw": { "language": "xml" } } }, "url": { "raw": "{{base_url}}/basic-auth-management", "host": [ "{{base_url}}" ], "path": [ "basic-auth-management" ] } }, "response": [] }, { "name": "Create uniform-service-in-connector", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", "pm.test(\"Body matches true\", function () {", " pm.expect(pm.response.text()).to.include(\"true\");", "});", "", "function getSoapBody() {", " var jsonObject = xml2Json(responseBody);", " return jsonObject['soap:Envelope']['soap:Body'];", "}", "", "pm.test(\"Response is true\", function () {", " var response = getSoapBody();", " pm.expect(response.response._).to.eql('true');", "});" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "password", "value": "{{adminPassword}}", "type": "string" }, { "key": "username", "value": "{{adminLogin}}", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/xml", "type": "text" } ], "body": { "mode": "raw", "raw": "\n \n \n \n uniform-service-in-connector\n {{system1_id}}\n \n \n \n \n \n", "options": { "raw": { "language": "xml" } } }, "url": { "raw": "{{base_url}}/system-management", "host": [ "{{base_url}}" ], "path": [ "system-management" ] } }, "response": [] }, { "name": "Create uniform-service-out-connector", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", "pm.test(\"Body matches true\", function () {", " pm.expect(pm.response.text()).to.include(\"true\");", "});", "", "function getSoapBody() {", " var jsonObject = xml2Json(responseBody);", " return jsonObject['soap:Envelope']['soap:Body'];", "}", "", "pm.test(\"Response is true\", function () {", " var response = getSoapBody();", " pm.expect(response.response._).to.eql('true');", "});" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "password", "value": "{{adminPassword}}", "type": "string" }, { "key": "username", "value": "{{adminLogin}}", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "type": "text", "value": "application/xml" } ], "body": { "mode": "raw", "raw": "\n \n \n \n uniform-service-out-connector\n {{system2_id}}\n \n \n \n \n \n", "options": { "raw": { "language": "xml" } } }, "url": { "raw": "{{base_url}}/system-management", "host": [ "{{base_url}}" ], "path": [ "system-management" ] } }, "response": [] }, { "name": "Create uniform-service-in-connector", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", "pm.test(\"Body matches true\", function () {", " pm.expect(pm.response.text()).to.include(\"true\");", "});", "", "function getSoapBody() {", " var jsonObject = xml2Json(responseBody);", " return jsonObject['soap:Envelope']['soap:Body'];", "}", "", "pm.test(\"Response is true\", function () {", " var response = getSoapBody();", " pm.expect(response.response._).to.eql('true');", "});" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "password", "value": "{{adminPassword}}", "type": "string" }, { "key": "username", "value": "{{adminLogin}}", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "type": "text", "value": "application/xml" } ], "body": { "mode": "raw", "raw": "\n \n \n \n uniform-service-in-connector\n {{system2_id}}\n \n \n \n \n \n", "options": { "raw": { "language": "xml" } } }, "url": { "raw": "{{base_url}}/system-management", "host": [ "{{base_url}}" ], "path": [ "system-management" ] } }, "response": [] }, { "name": "Get profile system1", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", "var systemId = pm.environment.get(\"system1_id\");", "", "pm.test(\"Body matches \" + systemId, function () {", " pm.expect(pm.response.text()).to.include(systemId);", "});", "", "function getSoapBody() {", " var jsonObject = xml2Json(responseBody);", " return jsonObject['soap:Envelope']['soap:Body'];", "}", "", "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "password", "value": "{{adminPassword}}", "type": "string" }, { "key": "username", "value": "{{adminLogin}}", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "type": "text", "value": "application/xml" }, { "key": "X-ForwardedUser", "value": "{{adminLogin}}", "type": "text" } ], "body": { "mode": "raw", "raw": "\n \n \n \n {{system1_id}}\n \n \n", "options": { "raw": { "language": "xml" } } }, "url": { "raw": "{{base_url}}/system-management", "host": [ "{{base_url}}" ], "path": [ "system-management" ] }, "description": "Проверить созданный профиль можно с помощью метода getProfile, где вместо “system_uuid” нужно подставить uuid системы\n" }, "response": [] }, { "name": "Get profile system2", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", "var systemId = pm.environment.get(\"system2_id\");", "", "pm.test(\"Body matches \" + systemId, function () {", " pm.expect(pm.response.text()).to.include(systemId);", "});", "", "function getSoapBody() {", " var jsonObject = xml2Json(responseBody);", " return jsonObject['soap:Envelope']['soap:Body'];", "}", "", "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "password", "value": "{{adminPassword}}", "type": "string" }, { "key": "username", "value": "{{adminLogin}}", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "type": "text", "value": "application/xml" }, { "key": "X-ForwardedUser", "value": "{{adminLogin}}", "type": "text" } ], "body": { "mode": "raw", "raw": "\n \n \n \n {{system2_id}}\n \n \n", "options": { "raw": { "language": "xml" } } }, "url": { "raw": "{{base_url}}/system-management", "host": [ "{{base_url}}" ], "path": [ "system-management" ] }, "description": "Проверить созданный профиль можно с помощью метода getProfile, где вместо “system_uuid” нужно подставить uuid системы\n" }, "response": [] }, { "name": "Create permission", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", "pm.test(\"Body matches true\", function () {", " pm.expect(pm.response.text()).to.include(\"true\");", "});", "", "function getSoapBody() {", " var jsonObject = xml2Json(responseBody);", " return jsonObject['soap:Envelope']['soap:Body'];", "}", "", "pm.test(\"Response is true\", function () {", " var response = getSoapBody();", " pm.expect(response.response._).to.eql('true');", "});", "", "setTimeout(function(){}, 5000);", "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "password", "value": "{{adminPassword}}", "type": "string" }, { "key": "username", "value": "{{adminLogin}}", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/xml", "type": "text" } ], "body": { "mode": "raw", "raw": "\n \n \n \n {{system1_id}}\n {{system2_id}}\n \n \n", "options": { "raw": { "language": "xml" } } }, "url": { "raw": "{{base_url}}/system-management", "host": [ "{{base_url}}" ], "path": [ "system-management" ] } }, "response": [] } ] }, { "name": "uniform-exchange-connector", "item": [ { "name": "SEND", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", "function getSoapBody() {", " var soapBody = responseBody.match(//g);", " var jsonObject = xml2Json(soapBody);", " return jsonObject['soap:Envelope']['soap:Body'];", "}", "", "pm.test(\"Response is OK\", function () {", " var response = getSoapBody();", " pm.expect(response['response']['status']).to.eql('200');", "});", "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "password", "value": "{{system1Password}}", "type": "string" }, { "key": "username", "value": "{{system1Login}}", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/xml; charset=UTF-8", "type": "text" } ], "body": { "mode": "raw", "raw": "\n \n \n \n \n \t\n \t\t\n \t{{system2_id}}\n \t\n \t\n \n b7e6aab7-8f02-443c-8f67-e2d638dd4da0\n \n {{system1_id}}\n \n \n RequestNumber\n 111\n \n \n test1\n test1\n val\n \n \n\t \t\t\n\t \t\t\n\t \t\n\t \n \n \n \n \n\n" }, "url": { "raw": "{{base_url}}/uniform-exchange", "host": [ "{{base_url}}" ], "path": [ "uniform-exchange" ] } }, "response": [] }, { "name": "GET", "event": [ { "listen": "test", "script": { "exec": [ "function getSoapBody() {", " var soapBody = responseBody.match(//g);", " var jsonObject = xml2Json(soapBody);", " return jsonObject['soap:Envelope']['soap:Body'];", "}", "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", "var response = getSoapBody();", "", "pm.test(\"Has service response\", function () {", " pm.expect(response).to.have.property('response');", "});", "", "if (response.hasOwnProperty('response')) {", " var packet = response['response']['packets']['packet'];", "", " var header = packet['header'];", " ", " var message_id = header['transportUUID'];", " ", " console.log(packet['message']['content']);", " console.log(message_id);", " ", " pm.globals.set('message_uuid', message_id);", " ", " pm.test(\"Content is OK\", function () {", " pm.expect(packet['message']['content']).to.be.an('object');", " });", " ", " pm.test(\"message_id is OK\", function () {", " pm.expect(message_id).to.have.lengthOf(36);", " });", "}" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "password", "value": "{{system2Password}}", "type": "string" }, { "key": "username", "value": "{{system2Login}}", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "type": "text", "value": "application/xml; charset=UTF-8" } ], "body": { "mode": "raw", "raw": "\r\n \r\n \r\n \r\n \r\n {{system2_id}}\r\n system.name\r\n \r\n 1\r\n 0\r\n \r\n \r\n", "options": { "raw": { "language": "xml" } } }, "url": { "raw": "{{base_url}}/uniform-exchange", "host": [ "{{base_url}}" ], "path": [ "uniform-exchange" ] } }, "response": [] }, { "name": "ACK", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", "function getSoapBody() {", " var soapBody = responseBody.match(//g);", " var jsonObject = xml2Json(soapBody);", " return jsonObject['soap:Envelope']['soap:Body'];", "}", "", "pm.test(\"Response is 200\", function () {", " var response = getSoapBody();", " pm.expect(response['response']['status']).to.eql('200');", "});", "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "password", "value": "{{system2Password}}", "type": "string" }, { "key": "username", "value": "{{system2Login}}", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "type": "text", "value": "application/xml; charset=UTF-8" } ], "body": { "mode": "raw", "raw": "\r\n \r\n \r\n \r\n {{message_uuid}}\r\n \r\n \r\n\r\n" }, "url": { "raw": "{{base_url}}/uniform-exchange", "host": [ "{{base_url}}" ], "path": [ "uniform-exchange" ] } }, "response": [] } ], "event": [ { "listen": "prerequest", "script": { "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "type": "text/javascript", "exec": [ "" ] } } ] }, { "name": "clean esb", "item": [ { "name": "Remove profile system1", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", "pm.test(\"Body matches true\", function () {", " pm.expect(pm.response.text()).to.include(\"true\");", "});", "", "function getSoapBody() {", " var jsonObject = xml2Json(responseBody);", " return jsonObject['soap:Envelope']['soap:Body'];", "}", "", "pm.test(\"Response is true\", function () {", " var response = getSoapBody();", " pm.expect(response.response._).to.eql('true');", "});" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "password", "value": "{{adminPassword}}", "type": "string" }, { "key": "username", "value": "{{adminLogin}}", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/xml", "type": "text" }, { "key": "X-ForwardedUser", "value": "{{adminLogin}}", "type": "text" } ], "body": { "mode": "raw", "raw": "\n \n \n \n {{system1_id}}\n \n \n", "options": { "raw": { "language": "xml" } } }, "url": { "raw": "{{base_url}}/system-management", "host": [ "{{base_url}}" ], "path": [ "system-management" ] } }, "response": [] }, { "name": "Remove profile system2", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", "pm.test(\"Body matches true\", function () {", " pm.expect(pm.response.text()).to.include(\"true\");", "});", "", "function getSoapBody() {", " var jsonObject = xml2Json(responseBody);", " return jsonObject['soap:Envelope']['soap:Body'];", "}", "", "pm.test(\"Response is true\", function () {", " var response = getSoapBody();", " pm.expect(response.response._).to.eql('true');", "});" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "password", "value": "{{adminPassword}}", "type": "string" }, { "key": "username", "value": "{{adminLogin}}", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/xml", "type": "text" }, { "key": "X-ForwardedUser", "value": "{{adminLogin}}", "type": "text" } ], "body": { "mode": "raw", "raw": "\n \n \n \n {{system2_id}}\n \n \n", "options": { "raw": { "language": "xml" } } }, "url": { "raw": "{{base_url}}/system-management", "host": [ "{{base_url}}" ], "path": [ "system-management" ] } }, "response": [] }, { "name": "Remove Account system1", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", "pm.test(\"Body matches true\", function () {", " pm.expect(pm.response.text()).to.include(\"true\");", "});", "", "function getSoapBody() {", " var soapBody = responseBody.match(//g);", " var jsonObject = xml2Json(soapBody);", " return jsonObject['soap:Envelope']['soap:Body'];", "}", "", "pm.test(\"Response is true\", function () {", " var response = getSoapBody();", " pm.expect(response.response._).to.eql('true');", "});" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "password", "value": "{{adminPassword}}", "type": "string" }, { "key": "username", "value": "{{adminLogin}}", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/xml", "type": "text" }, { "key": "X-ForwardedUser", "value": "{{adminLogin}}", "type": "text" } ], "body": { "mode": "raw", "raw": "\n \n \n \n \n {{system1_id}}\n \n \n", "options": { "raw": { "language": "xml" } } }, "url": { "raw": "{{base_url}}/basic-auth-management", "host": [ "{{base_url}}" ], "path": [ "basic-auth-management" ] } }, "response": [] }, { "name": "Remove Account system2", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", "pm.test(\"Body matches true\", function () {", " pm.expect(pm.response.text()).to.include(\"true\");", "});", "", "function getSoapBody() {", " var soapBody = responseBody.match(//g);", " var jsonObject = xml2Json(soapBody);", " return jsonObject['soap:Envelope']['soap:Body'];", "}", "", "pm.test(\"Response is true\", function () {", " var response = getSoapBody();", " pm.expect(response.response._).to.eql('true');", "});" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "password", "value": "{{adminPassword}}", "type": "string" }, { "key": "username", "value": "{{adminLogin}}", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/xml", "type": "text" }, { "key": "X-ForwardedUser", "value": "{{adminLogin}}", "type": "text" } ], "body": { "mode": "raw", "raw": "\n \n \n \n \n {{system2_id}}\n \n \n", "options": { "raw": { "language": "xml" } } }, "url": { "raw": "{{base_url}}/basic-auth-management", "host": [ "{{base_url}}" ], "path": [ "basic-auth-management" ] } }, "response": [] } ] } ], "description": "для тестирования нужно добавть в environment: system1_id, system2_id", "event": [ { "listen": "prerequest", "script": { "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "type": "text/javascript", "exec": [ "" ] } } ] } ] }