From a74045bd68f866786381299c0d43d4f1d08cc388 Mon Sep 17 00:00:00 2001 From: amarmodus <53434415+amarmodus@users.noreply.github.com> Date: Thu, 12 Mar 2020 13:32:29 +0000 Subject: [PATCH] Updated authorization tests - 200 and 202 (#95) *Basic check for authorizations GET, PUT - 202 and 200 respectively s --- Golden_Path.postman_collection.json | 218 +++++++++++++++++++--------- 1 file changed, 148 insertions(+), 70 deletions(-) diff --git a/Golden_Path.postman_collection.json b/Golden_Path.postman_collection.json index 642cd2c..ad5cdca 100644 --- a/Golden_Path.postman_collection.json +++ b/Golden_Path.postman_collection.json @@ -13709,7 +13709,7 @@ "response": [] }, { - "name": "Missing content type", + "name": "Missing Date ", "event": [ { "listen": "test", @@ -13761,13 +13761,13 @@ "key": "Content-Type", "name": "Content-Type", "value": "application/vnd.interoperability.transactionRequests+json;version=1.0", - "type": "text", - "disabled": true + "type": "text" }, { "key": "Date", "value": "{{transactionRequestDate}}", - "type": "text" + "type": "text", + "disabled": true }, { "key": "fspiop-source", @@ -13836,7 +13836,7 @@ "response": [] }, { - "name": "Missing Date ", + "name": "Missing fsip-source", "event": [ { "listen": "test", @@ -13893,13 +13893,13 @@ { "key": "Date", "value": "{{transactionRequestDate}}", - "type": "text", - "disabled": true + "type": "text" }, { "key": "fspiop-source", "value": "{{payerfsp}}", - "type": "text" + "type": "text", + "disabled": true }, { "key": "Content-Length", @@ -13963,7 +13963,7 @@ "response": [] }, { - "name": "Missing fsip-source", + "name": "Wrong content version ", "event": [ { "listen": "test", @@ -13972,16 +13972,16 @@ "exec": [ "const jsonData = pm.response.json();", "", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 406\", function () {", + " pm.response.to.have.status(406);", "});", "", - "pm.test(\"Check Generic validation error \", function () {", - " pm.expect(jsonData.errorInformation.errorDescription).to.include('Generic validation error ');", + "pm.test(\"Check Unacceptable version requested\", function () {", + " pm.expect(jsonData.errorInformation.errorDescription).to.include('Unacceptable version requested');", "});", "", - "pm.test(\"Check Error code 3100\", function () {", - " pm.expect(jsonData.errorInformation.errorCode).to.eql('3100');", + "pm.test(\"Check Error code 3001\", function () {", + " pm.expect(jsonData.errorInformation.errorCode).to.eql('3001');", "});" ], "type": "text/javascript" @@ -14014,7 +14014,7 @@ { "key": "Content-Type", "name": "Content-Type", - "value": "application/vnd.interoperability.transactionRequests+json;version=1.0", + "value": "application/vnd.interoperability.transactionRequests+json;version=4.0", "type": "text" }, { @@ -14025,8 +14025,7 @@ { "key": "fspiop-source", "value": "{{payerfsp}}", - "type": "text", - "disabled": true + "type": "text" }, { "key": "Content-Length", @@ -14090,7 +14089,7 @@ "response": [] }, { - "name": "Wrong content version ", + "name": "Unsupported Media Type", "event": [ { "listen": "test", @@ -14099,16 +14098,16 @@ "exec": [ "const jsonData = pm.response.json();", "", - "pm.test(\"Status code is 406\", function () {", - " pm.response.to.have.status(406);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});", "", - "pm.test(\"Check Unacceptable version requested\", function () {", - " pm.expect(jsonData.errorInformation.errorDescription).to.include('Unacceptable version requested');", + "pm.test(\"Check Malformed syntax - Unsupported Media Type\", function () {", + " pm.expect(jsonData.errorInformation.errorDescription).to.include('Malformed syntax - Unsupported Media Type');", "});", "", - "pm.test(\"Check Error code 3001\", function () {", - " pm.expect(jsonData.errorInformation.errorCode).to.eql('3001');", + "pm.test(\"Check Error code 3101\", function () {", + " pm.expect(jsonData.errorInformation.errorCode).to.eql('3101');", "});" ], "type": "text/javascript" @@ -14141,7 +14140,7 @@ { "key": "Content-Type", "name": "Content-Type", - "value": "application/vnd.interoperability.transactionRequests+json;version=4.0", + "value": "application/vnd.interoperability.transactionRequests+xml;version=1.0", "type": "text" }, { @@ -14214,27 +14213,24 @@ } }, "response": [] - }, + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "authorizations", + "item": [ { - "name": "Unsupported Media Type", + "name": "authorizations", "event": [ { "listen": "test", "script": { - "id": "9ad0a55e-eb18-4254-bd15-c4fc78a3eddd", + "id": "a591ec31-0179-4938-ac00-e5c09b0d142c", "exec": [ - "const jsonData = pm.response.json();", - "", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "", - "pm.test(\"Check Malformed syntax - Unsupported Media Type\", function () {", - " pm.expect(jsonData.errorInformation.errorDescription).to.include('Malformed syntax - Unsupported Media Type');", - "});", - "", - "pm.test(\"Check Error code 3101\", function () {", - " pm.expect(jsonData.errorInformation.errorCode).to.eql('3101');", + "pm.test(\"Status code is 202\", function () {", + " pm.response.to.have.status(202);", "});" ], "type": "text/javascript" @@ -14243,7 +14239,7 @@ { "listen": "prerequest", "script": { - "id": "bf383c06-2d3a-4a4f-82c5-1866e9d13adb", + "id": "b4ebea00-d146-4f2f-97d2-d99cb5d8d2ad", "exec": [ "pm.environment.set('transactionRequestDate', (new Date()).toUTCString());", "", @@ -14257,7 +14253,7 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "Accept", @@ -14266,8 +14262,7 @@ }, { "key": "Content-Type", - "name": "Content-Type", - "value": "application/vnd.interoperability.transactionRequests+xml;version=1.0", + "value": "application/vnd.interoperability.transactionRequests+json;version=1.0", "type": "text" }, { @@ -14281,27 +14276,115 @@ "type": "text" }, { - "key": "Content-Length", - "value": "", - "type": "text", - "disabled": true + "key": "fspiop-destination", + "value": "{{payeefsp}}", + "type": "text" }, { - "key": "x-forwarded-for", - "value": "", - "type": "text", - "disabled": true + "key": "fspiop-signature", + "value": "{{fspiop-signature}}", + "type": "text" }, { - "key": "fspiop-destination", + "key": "fspiop-uri", + "value": "/transactionRequests", + "type": "text" + }, + { + "key": "fspiop-http-method", + "value": "GET", + "type": "text" + } + ], + "url": { + "raw": "{{HOST_TRANSACTION_REQUESTS_SERVICE}}/authorizations/{{transactionRequestId}}?authenticationType=OTP&retriesLeft=2&amount=102¤cy=USD", + "host": [ + "{{HOST_TRANSACTION_REQUESTS_SERVICE}}" + ], + "path": [ + "authorizations", + "{{transactionRequestId}}" + ], + "query": [ + { + "key": "authenticationType", + "value": "OTP" + }, + { + "key": "retriesLeft", + "value": "2" + }, + { + "key": "amount", + "value": "102" + }, + { + "key": "currency", + "value": "USD" + } + ] + } + }, + "response": [] + }, + { + "name": "authorizations", + "event": [ + { + "listen": "test", + "script": { + "id": "a591ec31-0179-4938-ac00-e5c09b0d142c", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "id": "b4ebea00-d146-4f2f-97d2-d99cb5d8d2ad", + "exec": [ + "pm.environment.set('transactionRequestDate', (new Date()).toUTCString());", + "", + "var uuid = require('uuid');", + "var generatedUUID = uuid.v4();", + "", + "pm.environment.set('transactionRequestId', generatedUUID);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "value": "application/vnd.interoperability.transactionRequests+json;version=1", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/vnd.interoperability.transactionRequests+json;version=1.0", + "type": "text" + }, + { + "key": "Date", + "value": "{{transactionRequestDate}}", + "type": "text" + }, + { + "key": "fspiop-source", "value": "{{payeefsp}}", "type": "text" }, { - "key": "fspiop-encryption", - "value": "", - "type": "text", - "disabled": true + "key": "fspiop-destination", + "value": "{{payerfsp}}", + "type": "text" }, { "key": "fspiop-signature", @@ -14310,32 +14393,27 @@ }, { "key": "fspiop-uri", - "value": "", - "type": "text", - "disabled": true + "value": "/transactionRequests", + "type": "text" }, { "key": "fspiop-http-method", - "value": "POST", + "value": "PUT", "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n \"transactionRequestId\": \"{{transactionRequestId}}\",\n \"payee\": {\n \"partyIdInfo\": {\n \"partyIdType\": \"PERSONAL_ID\",\n \"partyIdentifier\": \"16135551212\",\n \"partySubIdOrType\": \"DRIVING_LICENSE\",\n \"fspId\": \"1234\"\n },\n \"merchantClassificationCode\": \"4321\",\n \"name\": \"Justin Trudeau\",\n \"personalInfo\": {\n \"complexName\": {\n \"firstName\": \"Justin\",\n \"middleName\": \"Pierre\",\n \"lastName\": \"Trudeau\"\n },\n \"dateOfBirth\": \"1971-12-25\"\n }\n },\n \"payer\": {\n \"partyIdType\": \"PERSONAL_ID\",\n \"partyIdentifier\": \"16135551212\",\n \"partySubIdOrType\": \"DRIVING_LICENSE\",\n \"fspId\": \"1234\"\n },\n \"amount\": {\n \"currency\": \"USD\",\n \"amount\": \"123.45\"\n },\n \"transactionType\": {\n \"scenario\": \"DEPOSIT\",\n \"subScenario\": \"locally defined sub-scenario\",\n \"initiator\": \"PAYEE\",\n \"initiatorType\": \"CONSUMER\",\n \"refundInfo\": {\n \"originalTransactionId\": \"{{transactionRequestId}}\",\n \"refundReason\": \"free text indicating reason for the refund\"\n },\n \"balanceOfPayments\": \"123\"\n },\n \"note\": \"Free-text memo\",\n \"geoCode\": {\n \"latitude\": \"+45.4215\",\n \"longitude\": \"+75.6972\"\n },\n \"authenticationType\": \"OTP\",\n \"expiration\": \"2016-05-24T08:38:08.699-04:00\",\n \"extensionList\": {\n \"extension\": [\n {\n \"key\": \"errorDescription\",\n \"value\": \"This is a more detailed error description\"\n },\n {\n \"key\": \"errorDescription\",\n \"value\": \"This is a more detailed error description\"\n }\n ]\n }\n}", - "options": { - "raw": { - "language": "json" - } - } + "raw": "{\n \"authenticationInfo\": {\n \"authentication\": \"OTP\",\n \"authenticationValue\": \"234567\"\n },\n \"responseType\": \"REJECTED\"\n}" }, "url": { - "raw": "{{HOST_TRANSACTION_REQUESTS_SERVICE}}/transactionRequests", + "raw": "{{HOST_TRANSACTION_REQUESTS_SERVICE}}/authorizations/{{transactionRequestId}}", "host": [ "{{HOST_TRANSACTION_REQUESTS_SERVICE}}" ], "path": [ - "transactionRequests" + "authorizations", + "{{transactionRequestId}}" ] } },