From 985f48542184f40f0168caedddbba3cc09265a0f Mon Sep 17 00:00:00 2001 From: amtryingmybest Date: Wed, 9 Apr 2025 16:01:23 +0300 Subject: [PATCH 1/2] feat: add negative scenarios tests for quoting service --- .../negative_scenarios/quotes_negative.json | 2327 +++++++++++++++++ 1 file changed, 2327 insertions(+) create mode 100644 collections/hub/golden_path/negative_scenarios/quotes_negative.json diff --git a/collections/hub/golden_path/negative_scenarios/quotes_negative.json b/collections/hub/golden_path/negative_scenarios/quotes_negative.json new file mode 100644 index 00000000..7f0dcdee --- /dev/null +++ b/collections/hub/golden_path/negative_scenarios/quotes_negative.json @@ -0,0 +1,2327 @@ +{ + "options": { + "breakOnError": false, + "transformerName": "none", + "generateIDType": "ulid" + }, + "name": "collections_hub_golden_path_negative_scenarios", + "test_cases": [ + { + "id": 1, + "name": "POST /quotes with missing headers", + "fileInfo": { + "path": "collections/hub/golden_path/negative_scenarios/quotes_negative.json" + }, + "requests": [ + { + "id": 1, + "description": "POST /quotes", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": ["expect(response.status).to.equal(400)"] + }, + { + "id": 2, + "description": "Response statusText be Bad Request", + "exec": ["expect(response.statusText).to.equal('Bad Request')"] + }, + { + "id": 3, + "description": "Response should contain error information", + "exec": [ + "expect(response.body).to.have.property('errorInformation')" + ] + }, + { + "id": 4, + "description": "Response should contain error code", + "exec": [ + "expect(response.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 5, + "description": "error code should be '3102'", + "exec": [ + "expect(response.body.errorInformation.errorCode).to.include('3102')" + ] + }, + { + "id": 6, + "description": "Response should contain fspiop-destination", + "exec": [ + "expect(response.body.errorInformation.errorDescription).to.include('fspiop-destination')" + ] + } + ] + }, + "body": { + "quoteId": "{$function.generic.generateUUID}", + "transactionId": "{$function.generic.generateUUID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.fromIdType}", + "partyIdentifier": "{$inputs.fromIdValue}", + "fspId": "{$inputs.fromFspId}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.fromFirstName}", + "lastName": "{$inputs.fromLastName}" + }, + "dateOfBirth": "{$inputs.fromDOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.toIdType}", + "partyIdentifier": "{$inputs.toIdValue}", + "fspId": "{$inputs.fromFspId}" + } + }, + "amountType": "SEND", + "amount": { + "amount": "{$inputs.amount}", + "currency": "{$inputs.currency}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + }, + "note": "{$inputs.note}" + }, + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.fromFspId}" + } + }, + { + "id": 2, + "description": "Post Quote - Missing content header (BUG)", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.fromFspId}" + }, + "body": { + "quoteId": "{$function.generic.generateUUID}", + "transactionId": "{$function.generic.generateUUID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.fromIdType}", + "partyIdentifier": "{$inputs.fromIdValue}", + "fspId": "{$inputs.fromFspId}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.fromFirstName}", + "lastName": "{$inputs.fromLastName}" + }, + "dateOfBirth": "{$inputs.fromDOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.toIdType}", + "partyIdentifier": "{$inputs.toIdValue}", + "fspId": "{$inputs.fromFspId}" + } + }, + "amountType": "SEND", + "amount": { + "amount": "{$inputs.amount}", + "currency": "{$inputs.currency}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + }, + "note": "{$inputs.note}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": ["expect(response.status).to.equal(400)"] + }, + { + "id": 2, + "description": "Response statusText be Bad Request", + "exec": ["expect(response.statusText).to.equal('Bad Request')"] + }, + { + "id": 3, + "description": "Response should contain error information", + "exec": [ + "expect(response.body).to.have.property('errorInformation')" + ] + }, + { + "id": 4, + "description": "Response should contain error code", + "exec": [ + "expect(response.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 6, + "description": "error code should be '3102'", + "exec": [ + "expect(response.body.errorInformation.errorCode).to.include('3101')" + ] + }, + { + "id": 7, + "description": "Response should contain content header", + "exec": [ + "expect(response.body.errorInformation.errorDescription).to.include('content-type')" + ] + } + ] + } + }, + { + "id": 3, + "description": "Post Quote - Missing Accept header", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": ["expect(response.status).to.equal(400)"] + }, + { + "id": 2, + "description": "Response statusText be Bad Request", + "exec": ["expect(response.statusText).to.equal('Bad Request')"] + }, + { + "id": 3, + "description": "Response should contain error information", + "exec": [ + "expect(response.body).to.have.property('errorInformation')" + ] + }, + { + "id": 4, + "description": "Response should contain error code", + "exec": [ + "expect(response.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 5, + "description": "Response should contain Accept", + "exec": [ + "expect(response.body.errorInformation.errorDescription).to.include('accept')" + ] + }, + { + "id": 6, + "description": "error code should be '3102'", + "exec": [ + "expect(response.body.errorInformation.errorCode).to.include('3102')" + ] + } + ] + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "headers": { + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.fromFspId}" + }, + "body": { + "quoteId": "{$function.generic.generateUUID}", + "transactionId": "{$function.generic.generateUUID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.fromIdType}", + "partyIdentifier": "{$inputs.fromIdValue}", + "fspId": "{$inputs.fromFspId}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.fromFirstName}", + "lastName": "{$inputs.fromLastName}" + }, + "dateOfBirth": "{$inputs.fromDOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.toIdType}", + "partyIdentifier": "{$inputs.toIdValue}", + "fspId": "{$inputs.fromFspId}" + } + }, + "amountType": "SEND", + "amount": { + "amount": "{$inputs.amount}", + "currency": "{$inputs.currency}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + }, + "note": "{$inputs.note}" + } + }, + { + "id": 4, + "description": "Post Quote - Missing Date header", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "FSPIOP-Source": "{$inputs.fromFspId}" + }, + "body": { + "quoteId": "b51ec534-ee48-4575-b6a9-ead2955b8069", + "transactionId": "b51ec534-ee48-4575-b6a9-ead2955b8069", + "transactionRequestId": "b51ec534-ee48-4575-b6a9-ead2955b8069", + "payee": { + "partyIdInfo": { + "partyIdType": "MSISDN", + "partyIdentifier": "16135551212", + "partySubIdOrType": "string", + "fspId": "string", + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "merchantClassificationCode": "string", + "name": "string", + "personalInfo": { + "complexName": { + "firstName": "Henrik", + "middleName": "Johannes", + "lastName": "Karlsson" + }, + "dateOfBirth": "1966-06-16", + "kycInformation": "{\n \"metadata\": {\n \"format\": \"JSON\",\n \"version\": \"1.0\",\n \"description\": \"Data containing KYC Information\"\n },\n \"data\": {\n \"name\": \"John Doe\",\n \"dob\": \"1980-05-15\",\n \"gender\": \"Male\",\n \"address\": \"123 Main Street, Anytown, USA\",\n \"email\": \"johndoe@example.com\",\n \"phone\": \"+1 555-123-4567\",\n \"nationality\": \"US\",\n \"passport_number\": \"AB1234567\",\n \"issue_date\": \"2010-02-20\",\n \"expiry_date\": \"2025-02-20\",\n \"bank_account_number\": \"1234567890\",\n \"bank_name\": \"Example Bank\",\n \"employer\": \"ABC Company\",\n \"occupation\": \"Software Engineer\",\n \"income\": \"$80,000 per year\",\n \"marital_status\": \"Single\",\n \"dependents\": 0,\n \"risk_level\": \"Low\"\n }\n}" + }, + "supportedCurrencies": ["AED"] + }, + "payer": { + "partyIdInfo": { + "partyIdType": "MSISDN", + "partyIdentifier": "16135551212", + "partySubIdOrType": "string", + "fspId": "string", + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "merchantClassificationCode": "string", + "name": "string", + "personalInfo": { + "complexName": { + "firstName": "Henrik", + "middleName": "Johannes", + "lastName": "Karlsson" + }, + "dateOfBirth": "1966-06-16", + "kycInformation": "{\n \"metadata\": {\n \"format\": \"JSON\",\n \"version\": \"1.0\",\n \"description\": \"Data containing KYC Information\"\n },\n \"data\": {\n \"name\": \"John Doe\",\n \"dob\": \"1980-05-15\",\n \"gender\": \"Male\",\n \"address\": \"123 Main Street, Anytown, USA\",\n \"email\": \"johndoe@example.com\",\n \"phone\": \"+1 555-123-4567\",\n \"nationality\": \"US\",\n \"passport_number\": \"AB1234567\",\n \"issue_date\": \"2010-02-20\",\n \"expiry_date\": \"2025-02-20\",\n \"bank_account_number\": \"1234567890\",\n \"bank_name\": \"Example Bank\",\n \"employer\": \"ABC Company\",\n \"occupation\": \"Software Engineer\",\n \"income\": \"$80,000 per year\",\n \"marital_status\": \"Single\",\n \"dependents\": 0,\n \"risk_level\": \"Low\"\n }\n}" + }, + "supportedCurrencies": ["AED"] + }, + "amountType": "RECEIVE", + "amount": { + "currency": "AED", + "amount": "123.45" + }, + "fees": { + "currency": "AED", + "amount": "123.45" + }, + "transactionType": { + "scenario": "DEPOSIT", + "subScenario": "LOCALLY_DEFINED_SUBSCENARIO", + "initiator": "PAYEE", + "initiatorType": "CONSUMER", + "refundInfo": { + "originalTransactionId": "b51ec534-ee48-4575-b6a9-ead2955b8069", + "refundReason": "Free text indicating reason for the refund." + }, + "balanceOfPayments": "123" + }, + "converter": "PAYER", + "currencyConversion": { + "sourceAmount": { + "currency": "AED", + "amount": "123.45" + }, + "targetAmount": { + "currency": "AED", + "amount": "123.45" + } + }, + "geoCode": { + "latitude": "+45.4215", + "longitude": "+75.6972" + }, + "note": "Note sent to Payee.", + "expiration": "2016-05-24T08:38:08.699-04:00", + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": ["expect(response.status).to.equal(400)"] + }, + { + "id": 2, + "description": "Response statusText be Bad Request", + "exec": ["expect(response.statusText).to.equal('Bad Request')"] + }, + { + "id": 3, + "description": "Response should contain error information", + "exec": [ + "expect(response.body).to.have.property('errorInformation')" + ] + }, + { + "id": 4, + "description": "Response should contain error code", + "exec": [ + "expect(response.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 5, + "description": "Response should contain date", + "exec": [ + "expect(response.body.errorInformation.errorDescription).to.include('date')" + ] + }, + { + "id": 6, + "description": "error code should be '3102'", + "exec": [ + "expect(response.body.errorInformation.errorCode).to.include('3102')" + ] + } + ] + } + }, + { + "id": 5, + "description": "Post Quote - Missing FSPIOP Source header", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "{$function.generic.curDate}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": ["expect(response.status).to.equal(400)"] + }, + { + "id": 2, + "description": "Response statusText be Bad Request", + "exec": ["expect(response.statusText).to.equal('Bad Request')"] + }, + { + "id": 3, + "description": "Response should contain error information", + "exec": [ + "expect(response.body).to.have.property('errorInformation')" + ] + }, + { + "id": 4, + "description": "Response should contain error code", + "exec": [ + "expect(response.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 5, + "description": "Response should contain fspiop", + "exec": [ + "expect(response.body.errorInformation.errorDescription).to.include('fspiop')" + ] + }, + { + "id": 6, + "description": "error code should be '3102'", + "exec": [ + "expect(response.body.errorInformation.errorCode).to.include('3102')" + ] + } + ] + }, + "body": { + "quoteId": "{$function.generic.generateUUID}", + "transactionId": "{$function.generic.generateUUID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.fromIdType}", + "partyIdentifier": "{$inputs.fromIdValue}", + "fspId": "{$inputs.fromFspId}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.fromFirstName}", + "lastName": "{$inputs.fromLastName}" + }, + "dateOfBirth": "{$inputs.fromDOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.toIdType}", + "partyIdentifier": "{$inputs.toIdValue}", + "fspId": "{$inputs.fromFspId}" + } + }, + "amountType": "SEND", + "amount": { + "amount": "{$inputs.amount}", + "currency": "{$inputs.currency}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + }, + "note": "{$inputs.note}" + } + } + ] + }, + { + "id": 2, + "name": "POST /quotes with invalid values in header", + "fileInfo": { + "path": "collections/hub/golden_path/negative_scenarios/quotes_negative.json" + }, + "requests": [ + { + "id": 1, + "description": "Send quote", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": ["expect(response.status).to.equal(202)"] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": ["expect(response.statusText).to.equal('Accepted')"] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback body should contain transferAmount", + "exec": [ + "expect(callback.body).to.not.have.property('transferAmount')" + ] + }, + { + "id": 8, + "description": "Request amountType to be SEND", + "exec": [ + "expect('{$request.body.amountType}').to.equal('SEND')" + ] + }, + { + "id": 9, + "description": "Request transactionType scenario to be TRANSFER", + "exec": [ + "expect('{$request.body.transactionType.scenario}').to.equal('TRANSFER')" + ] + }, + { + "id": 10, + "description": "Request transactionType initiator to be PAYER", + "exec": [ + "expect('{$request.body.transactionType.initiator}').to.equal('PAYER')" + ] + }, + { + "id": 11, + "description": "Request transactionType initiatorType to be CONSUMER", + "exec": [ + "expect('{$request.body.transactionType.initiatorType}').to.equal('CONSUMER')" + ] + }, + { + "id": 12, + "description": "Callback body should contain error information", + "exec": [ + "expect(callback.body).to.have.property('errorInformation')" + ] + }, + { + "id": 13, + "description": "Callback body should contain errorCode '3201'", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.include('3201')" + ] + }, + { + "id": 14, + "description": "Callback body should include Destination FSP error", + "exec": [ + "expect(callback.body.errorInformation.errorDescription).to.include('Destination FSP Error')" + ] + } + ] + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.fromFspId}", + "FSPIOP-Destination": "randomStringTest" + }, + "body": { + "quoteId": "{$function.generic.generateUUID}", + "transactionId": "{$function.generic.generateUUID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.fromIdType}", + "partyIdentifier": "{$inputs.fromIdValue}", + "fspId": "{$inputs.fromFspId}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.fromFirstName}", + "lastName": "{$inputs.fromLastName}" + }, + "dateOfBirth": "{$inputs.fromDOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.toIdType}", + "partyIdentifier": "{$inputs.toIdValue}", + "fspId": "{$inputs.fromFspId}" + } + }, + "amountType": "SEND", + "amount": { + "amount": "{$inputs.amount}", + "currency": "{$inputs.currency}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + }, + "note": "{$inputs.note}" + } + }, + { + "id": 2, + "description": "Post Quote - Wrong content header (BUG)", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": ["expect(response.status).to.equal(400)"] + }, + { + "id": 2, + "description": "Response statusText be Bad Request", + "exec": ["expect(response.statusText).to.equal('Bad Request')"] + }, + { + "id": 3, + "description": "Response should contain error information", + "exec": [ + "expect(response.body).to.have.property('errorInformation')" + ] + }, + { + "id": 4, + "description": "Response should contain error code", + "exec": [ + "expect(response.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 6, + "description": "Response should contain '3101'", + "exec": [ + "expect(response.body.errorInformation.errorCode).to.include('3101')" + ] + } + ] + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "application/vnd.interoperability.quotes+xml;version=5.0", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.fromFspId}" + } + }, + { + "id": 3, + "description": "Post Quote - Missing Accept header (BUG)", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": null, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": ["expect(response.status).to.equal(400)"] + }, + { + "id": 2, + "description": "Response statusText be Bad Request", + "exec": ["expect(response.statusText).to.equal('Bad Request')"] + }, + { + "id": 3, + "description": "Response should contain error information", + "exec": [ + "expect(response.body).to.have.property('errorInformation')" + ] + }, + { + "id": 4, + "description": "Response should contain error code", + "exec": [ + "expect(response.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 5, + "description": "Response should contain Accept", + "exec": [ + "expect(response.body.errorInformation.errorDescription).to.include('Accept')" + ] + }, + { + "id": 6, + "description": "Response should contain '3101'", + "exec": [ + "expect(response.body.errorInformation.errorCode).to.include('3001')" + ] + } + ] + }, + "headers": { + "Accept": "testAcceptText", + "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.fromFspId}" + } + }, + { + "id": 4, + "description": "Post Quote - Wrong Date header (BUG)", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": null, + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "Th12312412", + "FSPIOP-Source": "{$inputs.fromFspId}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": ["expect(response.status).to.equal(400)"] + }, + { + "id": 2, + "description": "Response statusText be Bad Request", + "exec": ["expect(response.statusText).to.equal('Bad Request')"] + }, + { + "id": 3, + "description": "Response should contain error information", + "exec": [ + "expect(response.body).to.have.property('errorInformation')" + ] + }, + { + "id": 4, + "description": "Response should contain error code", + "exec": [ + "expect(response.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 5, + "description": "Response should contain date", + "exec": [ + "expect(response.body.errorInformation.errorDescription).to.include('date')" + ] + } + ] + } + } + ] + }, + { + "id": 3, + "name": "POST /quotes with missing parameters in body", + "fileInfo": { + "path": "collections/hub/golden_path/negative_scenarios/quotes_negative.json" + }, + "requests": [ + { + "id": 1, + "description": "Post Quote - Missing quote ID in Body", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": ["expect(response.status).to.equal(400)"] + }, + { + "id": 2, + "description": "Response statusText be Bad Request", + "exec": ["expect(response.statusText).to.equal('Bad Request')"] + }, + { + "id": 3, + "description": "Response should contain error information", + "exec": [ + "expect(response.body).to.have.property('errorInformation')" + ] + }, + { + "id": 4, + "description": "Response should contain error code", + "exec": [ + "expect(response.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 5, + "description": "Response should contain quote", + "exec": [ + "expect(response.body.errorInformation.errorDescription).to.include('quote')" + ] + }, + { + "id": 6, + "description": "Response should contain '3100'", + "exec": [ + "expect(response.body.errorInformation.errorCode).to.include('3100')" + ] + } + ] + }, + "headers": { + "Accept": "application/vnd.interoperability.quotes+json;version=1.0", + "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.fromFspId}" + }, + "body": { + "quoteId": "", + "transactionId": "{$function.generic.generateUUID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.fromIdType}", + "partyIdentifier": "{$inputs.fromIdValue}", + "fspId": "{$inputs.fromFspId}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.fromFirstName}", + "lastName": "{$inputs.fromLastName}" + }, + "dateOfBirth": "{$inputs.fromDOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.toIdType}", + "partyIdentifier": "{$inputs.toIdValue}", + "fspId": "{$inputs.fromFspId}" + } + }, + "amountType": "SEND", + "amount": { + "amount": "{$inputs.amount}", + "currency": "{$inputs.currency}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + }, + "note": "{$inputs.note}" + } + }, + { + "id": 2, + "description": "Post Quote - Missing transaction ID in body", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": ["expect(response.status).to.equal(400)"] + }, + { + "id": 2, + "description": "Response statusText be Bad Request", + "exec": ["expect(response.statusText).to.equal('Bad Request')"] + }, + { + "id": 3, + "description": "Response should contain error information", + "exec": [ + "expect(response.body).to.have.property('errorInformation')" + ] + }, + { + "id": 4, + "description": "Response should contain error code", + "exec": [ + "expect(response.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 5, + "description": "Response should contain transaction", + "exec": [ + "expect(response.body.errorInformation.errorDescription).to.include('transaction')" + ] + }, + { + "id": 6, + "description": "Response should contain '3100'", + "exec": [ + "expect(response.body.errorInformation.errorCode).to.include('3100')" + ] + } + ] + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "headers": { + "Accept": "application/vnd.interoperability.quotes+json;version=1.0", + "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.fromFspId}" + }, + "body": { + "quoteId": "{$function.generic.generateUUID}", + "transactionId": "", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.fromIdType}", + "partyIdentifier": "{$inputs.fromIdValue}", + "fspId": "{$inputs.fromFspId}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.fromFirstName}", + "lastName": "{$inputs.fromLastName}" + }, + "dateOfBirth": "{$inputs.fromDOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.toIdType}", + "partyIdentifier": "{$inputs.toIdValue}", + "fspId": "{$inputs.fromFspId}" + } + }, + "amountType": "SEND", + "amount": { + "amount": "{$inputs.amount}", + "currency": "{$inputs.currency}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + }, + "note": "{$inputs.note}" + } + }, + { + "id": 3, + "description": "Post Quote - Missing payer info in body", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "headers": { + "Accept": "application/vnd.interoperability.quotes+json;version=1.0", + "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.fromFspId}" + }, + "body": { + "quoteId": "{$function.generic.generateUUID}", + "transactionId": "{$function.generic.generateUUID}", + "payer": { + "partyIdInfo": "", + "personalInfo": { + "complexName": { + "firstName": "{$inputs.fromFirstName}", + "lastName": "{$inputs.fromLastName}" + }, + "dateOfBirth": "{$inputs.fromDOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.toIdType}", + "partyIdentifier": "{$inputs.toIdValue}", + "fspId": "{$inputs.fromFspId}" + } + }, + "amountType": "SEND", + "amount": { + "amount": "{$inputs.amount}", + "currency": "{$inputs.currency}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + }, + "note": "{$inputs.note}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": ["expect(response.status).to.equal(400)"] + }, + { + "id": 2, + "description": "Response statusText be Bad Request", + "exec": ["expect(response.statusText).to.equal('Bad Request')"] + }, + { + "id": 3, + "description": "Response should contain error information", + "exec": [ + "expect(response.body).to.have.property('errorInformation')" + ] + }, + { + "id": 4, + "description": "Response should contain error code", + "exec": [ + "expect(response.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 5, + "description": "Response should contain payer", + "exec": [ + "expect(response.body.errorInformation.errorDescription).to.include('payer')" + ] + }, + { + "id": 6, + "description": "Response should contain '3101'", + "exec": [ + "expect(response.body.errorInformation.errorCode).to.include('3101')" + ] + } + ] + } + }, + { + "id": 4, + "description": "Post Quote - Missing amount type in Body", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "headers": { + "Accept": "application/vnd.interoperability.quotes+json;version=1.0", + "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.fromFspId}" + }, + "body": { + "quoteId": "{$function.generic.generateUUID}", + "transactionId": "{$function.generic.generateUUID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.fromIdType}", + "partyIdentifier": "{$inputs.fromIdValue}", + "fspId": "{$inputs.fromFspId}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.fromFirstName}", + "lastName": "{$inputs.fromLastName}" + }, + "dateOfBirth": "{$inputs.fromDOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.toIdType}", + "partyIdentifier": "{$inputs.toIdValue}", + "fspId": "{$inputs.fromFspId}" + } + }, + "amountType": "", + "amount": { + "amount": "{$inputs.amount}", + "currency": "{$inputs.currency}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + }, + "note": "{$inputs.note}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": ["expect(response.status).to.equal(400)"] + }, + { + "id": 2, + "description": "Response statusText be Bad Request", + "exec": ["expect(response.statusText).to.equal('Bad Request')"] + }, + { + "id": 3, + "description": "Response should contain error information", + "exec": [ + "expect(response.body).to.have.property('errorInformation')" + ] + }, + { + "id": 4, + "description": "Response should contain error code", + "exec": [ + "expect(response.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 5, + "description": "Response should contain amount", + "exec": [ + "expect(response.body.errorInformation.errorDescription).to.include('amount')" + ] + }, + { + "id": 6, + "description": "Response should contain '3100'", + "exec": [ + "expect(response.body.errorInformation.errorCode).to.include('3100')" + ] + } + ] + } + }, + { + "id": 5, + "description": "Post Quote - Missing amount in Body", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "headers": { + "Accept": "application/vnd.interoperability.quotes+json;version=1.0", + "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.fromFspId}" + }, + "body": { + "quoteId": "{$function.generic.generateUUID}", + "transactionId": "{$function.generic.generateUUID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.fromIdType}", + "partyIdentifier": "{$inputs.fromIdValue}", + "fspId": "{$inputs.fromFspId}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.fromFirstName}", + "lastName": "{$inputs.fromLastName}" + }, + "dateOfBirth": "{$inputs.fromDOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.toIdType}", + "partyIdentifier": "{$inputs.toIdValue}", + "fspId": "{$inputs.fromFspId}" + } + }, + "amountType": "SEND", + "amount": { + "amount": "", + "currency": "{$inputs.currency}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + }, + "note": "{$inputs.note}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": ["expect(response.status).to.equal(400)"] + }, + { + "id": 2, + "description": "Response statusText be Bad Request", + "exec": ["expect(response.statusText).to.equal('Bad Request')"] + }, + { + "id": 3, + "description": "Response should contain error information", + "exec": [ + "expect(response.body).to.have.property('errorInformation')" + ] + }, + { + "id": 4, + "description": "Response should contain error code", + "exec": [ + "expect(response.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 5, + "description": "Response should contain amount", + "exec": [ + "expect(response.body.errorInformation.errorDescription).to.include('amount')" + ] + }, + { + "id": 6, + "description": "Response should contain '3100'", + "exec": [ + "expect(response.body.errorInformation.errorCode).to.include('3100')" + ] + } + ] + } + }, + { + "id": 6, + "description": "Post Quote - Missing currency in Body", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "headers": { + "Accept": "application/vnd.interoperability.quotes+json;version=1.0", + "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.fromFspId}" + }, + "body": { + "quoteId": "{$function.generic.generateUUID}", + "transactionId": "{$function.generic.generateUUID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.fromIdType}", + "partyIdentifier": "{$inputs.fromIdValue}", + "fspId": "{$inputs.fromFspId}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.fromFirstName}", + "lastName": "{$inputs.fromLastName}" + }, + "dateOfBirth": "{$inputs.fromDOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.toIdType}", + "partyIdentifier": "{$inputs.toIdValue}", + "fspId": "{$inputs.fromFspId}" + } + }, + "amountType": "SEND", + "amount": { + "amount": "{$inputs.amount}", + "currency": "{}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + }, + "note": "{$inputs.note}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": ["expect(response.status).to.equal(400)"] + }, + { + "id": 2, + "description": "Response statusText be Bad Request", + "exec": ["expect(response.statusText).to.equal('Bad Request')"] + }, + { + "id": 3, + "description": "Response should contain error information", + "exec": [ + "expect(response.body).to.have.property('errorInformation')" + ] + }, + { + "id": 4, + "description": "Response should contain error code", + "exec": [ + "expect(response.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 5, + "description": "Response should contain currency", + "exec": [ + "expect(response.body.errorInformation.errorDescription).to.include('currency')" + ] + }, + { + "id": 6, + "description": "Response should contain '3100'", + "exec": [ + "expect(response.body.errorInformation.errorCode).to.include('3100')" + ] + } + ] + } + }, + { + "id": 7, + "description": "Post Quote - Missing transactionType-scenario in Body", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "headers": { + "Accept": "application/vnd.interoperability.quotes+json;version=1.0", + "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.fromFspId}" + }, + "body": { + "quoteId": "{$function.generic.generateUUID}", + "transactionId": "{$function.generic.generateUUID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.fromIdType}", + "partyIdentifier": "{$inputs.fromIdValue}", + "fspId": "{$inputs.fromFspId}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.fromFirstName}", + "lastName": "{$inputs.fromLastName}" + }, + "dateOfBirth": "{$inputs.fromDOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.toIdType}", + "partyIdentifier": "{$inputs.toIdValue}", + "fspId": "{$inputs.fromFspId}" + } + }, + "amountType": "SEND", + "amount": { + "amount": "{$inputs.amount}", + "currency": "{$inputs.currency}" + }, + "transactionType": { + "scenario": "", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + }, + "note": "{$inputs.note}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": ["expect(response.status).to.equal(400)"] + }, + { + "id": 2, + "description": "Response statusText be Bad Request", + "exec": ["expect(response.statusText).to.equal('Bad Request')"] + }, + { + "id": 3, + "description": "Response should contain error information", + "exec": [ + "expect(response.body).to.have.property('errorInformation')" + ] + }, + { + "id": 4, + "description": "Response should contain error code", + "exec": [ + "expect(response.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 5, + "description": "Response should contain transactionType", + "exec": [ + "expect(response.body.errorInformation.errorDescription).to.include('transactionType')" + ] + }, + { + "id": 6, + "description": "Response should contain '3100'", + "exec": [ + "expect(response.body.errorInformation.errorCode).to.include('3100')" + ] + } + ] + } + }, + { + "id": 8, + "description": "Post Quote - Missing transactionType-initiatorType in Body", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "headers": { + "Accept": "application/vnd.interoperability.quotes+json;version=1.0", + "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.fromFspId}" + }, + "body": { + "quoteId": "{$function.generic.generateUUID}", + "transactionId": "{$function.generic.generateUUID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.fromIdType}", + "partyIdentifier": "{$inputs.fromIdValue}", + "fspId": "{$inputs.fromFspId}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.fromFirstName}", + "lastName": "{$inputs.fromLastName}" + }, + "dateOfBirth": "{$inputs.fromDOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.toIdType}", + "partyIdentifier": "{$inputs.toIdValue}", + "fspId": "{$inputs.fromFspId}" + } + }, + "amountType": "SEND", + "amount": { + "amount": "{$inputs.amount}", + "currency": "{$inputs.currency}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "" + }, + "note": "{$inputs.note}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": ["expect(response.status).to.equal(400)"] + }, + { + "id": 2, + "description": "Response statusText be Bad Request", + "exec": ["expect(response.statusText).to.equal('Bad Request')"] + }, + { + "id": 3, + "description": "Response should contain error information", + "exec": [ + "expect(response.body).to.have.property('errorInformation')" + ] + }, + { + "id": 4, + "description": "Response should contain error code", + "exec": [ + "expect(response.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 5, + "description": "Response should contain transactionType", + "exec": [ + "expect(response.body.errorInformation.errorDescription).to.include('transactionType')" + ] + }, + { + "id": 6, + "description": "Response should contain '3100'", + "exec": [ + "expect(response.body.errorInformation.errorCode).to.include('3100')" + ] + } + ] + } + }, + { + "id": 9, + "description": "Post Quote - Missing transactionType-initiator in Body", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "headers": { + "Accept": "application/vnd.interoperability.quotes+json;version=1.0", + "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.fromFspId}" + }, + "body": { + "quoteId": "{$function.generic.generateUUID}", + "transactionId": "{$function.generic.generateUUID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.fromIdType}", + "partyIdentifier": "{$inputs.fromIdValue}", + "fspId": "{$inputs.fromFspId}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.fromFirstName}", + "lastName": "{$inputs.fromLastName}" + }, + "dateOfBirth": "{$inputs.fromDOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.toIdType}", + "partyIdentifier": "{$inputs.toIdValue}", + "fspId": "{$inputs.fromFspId}" + } + }, + "amountType": "SEND", + "amount": { + "amount": "{$inputs.amount}", + "currency": "{$inputs.currency}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "", + "initiatorType": "CONSUMER" + }, + "note": "{$inputs.note}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": ["expect(response.status).to.equal(400)"] + }, + { + "id": 2, + "description": "Response statusText be Bad Request", + "exec": ["expect(response.statusText).to.equal('Bad Request')"] + }, + { + "id": 3, + "description": "Response should contain error information", + "exec": [ + "expect(response.body).to.have.property('errorInformation')" + ] + }, + { + "id": 4, + "description": "Response should contain error code", + "exec": [ + "expect(response.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 5, + "description": "Response should contain transactionType", + "exec": [ + "expect(response.body.errorInformation.errorDescription).to.include('transactionType')" + ] + }, + { + "id": 6, + "description": "Response should contain '3100'", + "exec": [ + "expect(response.body.errorInformation.errorCode).to.include('3100')" + ] + } + ] + } + } + ] + }, + { + "id": 4, + "name": "POST /Quotes with wrong optional parameters and headers", + "fileInfo": { + "path": "collections/hub/golden_path/negative_scenarios/quotes_negative.json" + }, + "meta": { + "info": "POST /Quotes with wrong optional parameters and headers" + }, + "requests": [ + { + "id": 1, + "description": "Send quote", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "headers": { + "Accept": "application/vnd.interoperability.quotes+json;version=1.0", + "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.fromFspId}", + "FSPIOP-Destination": "{$inputs.fromFspId}" + }, + "body": { + "quoteId": "{$function.generic.generateUUID}", + "transactionId": "{$function.generic.generateUUID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.fromIdType}", + "partyIdentifier": "{$inputs.fromIdValue}", + "fspId": "{$inputs.fromFspId}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.fromFirstName}", + "lastName": "{$inputs.fromLastName}" + }, + "dateOfBirth": "{$inputs.fromDOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.toIdType}", + "partyIdentifier": "{$inputs.toIdValue}", + "fspId": "{$inputs.toFspId}" + } + }, + "amountType": "SEND", + "amount": { + "amount": "{$inputs.amount}", + "currency": "{$inputs.currency}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + }, + "note": "{$inputs.note}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": ["expect(response.status).to.equal(202)"] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": ["expect(response.statusText).to.equal('Accepted')"] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback body should contain transferAmount", + "exec": [ + "expect(callback.body).to.have.property('transferAmount')" + ] + }, + { + "id": 6, + "description": "Callback transferAmount (amount & currency)to match the request", + "exec": [ + "expect(callback.body.transferAmount.amount).to.equal('{$request.body.amount.amount}')", + "expect(callback.body.transferAmount.currency).to.equal('{$request.body.amount.currency}')" + ] + }, + { + "id": 7, + "description": "Callback content-type to be quotes", + "exec": [ + "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.quotes+json;version=1.0')" + ] + }, + { + "id": 8, + "description": "Request amountType to be SEND", + "exec": [ + "expect('{$request.body.amountType}').to.equal('SEND')" + ] + }, + { + "id": 9, + "description": "Request transactionType scenario to be TRANSFER", + "exec": [ + "expect('{$request.body.transactionType.scenario}').to.equal('TRANSFER')" + ] + }, + { + "id": 10, + "description": "Request transactionType initiator to be PAYER", + "exec": [ + "expect('{$request.body.transactionType.initiator}').to.equal('PAYER')" + ] + }, + { + "id": 11, + "description": "Request transactionType initiatorType to be CONSUMER", + "exec": [ + "expect('{$request.body.transactionType.initiatorType}').to.equal('CONSUMER')" + ] + }, + { + "id": 12, + "description": "Response should not have error information", + "exec": [ + "expect(response.body).to.not.have.property('errorInformation')" + ] + } + ] + } + }, + { + "id": 2, + "description": "Post Quote with wrong optional parameter - name", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "headers": { + "Accept": "application/vnd.interoperability.quotes+json;version=1.0", + "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.fromFspId}", + "FSPIOP-Destination": "{$inputs.fromFspId}" + }, + "body": { + "quoteId": "{$function.generic.generateUUID}", + "transactionId": "{$function.generic.generateUUID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.fromIdType}", + "partyIdentifier": "{$inputs.fromIdValue}", + "fspId": "{$inputs.fromFspId}" + }, + "personalInfo": { + "complexName": { + "firstName": "234213", + "lastName": "45626" + }, + "dateOfBirth": "{$inputs.fromDOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.toIdType}", + "partyIdentifier": "{$inputs.toIdValue}", + "fspId": "{$inputs.toFspId}" + } + }, + "amountType": "SEND", + "amount": { + "amount": "{$inputs.amount}", + "currency": "{$inputs.currency}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + }, + "note": "{$inputs.note}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": ["expect(response.status).to.equal(202)"] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": ["expect(response.statusText).to.equal('Accepted')"] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback body should contain transferAmount", + "exec": [ + "expect(callback.body).to.have.property('transferAmount')" + ] + }, + { + "id": 6, + "description": "Callback transferAmount (amount & currency)to match the request", + "exec": [ + "expect(callback.body.transferAmount.amount).to.equal('{$request.body.amount.amount}')", + "expect(callback.body.transferAmount.currency).to.equal('{$request.body.amount.currency}')" + ] + }, + { + "id": 7, + "description": "Callback content-type to be quotes", + "exec": [ + "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.quotes+json;version=1.0')" + ] + }, + { + "id": 8, + "description": "Request amountType to be SEND", + "exec": [ + "expect('{$request.body.amountType}').to.equal('SEND')" + ] + }, + { + "id": 9, + "description": "Request transactionType scenario to be TRANSFER", + "exec": [ + "expect('{$request.body.transactionType.scenario}').to.equal('TRANSFER')" + ] + }, + { + "id": 10, + "description": "Request transactionType initiator to be PAYER", + "exec": [ + "expect('{$request.body.transactionType.initiator}').to.equal('PAYER')" + ] + }, + { + "id": 11, + "description": "Request transactionType initiatorType to be CONSUMER", + "exec": [ + "expect('{$request.body.transactionType.initiatorType}').to.equal('CONSUMER')" + ] + }, + { + "id": 12, + "description": "Response should not have error information", + "exec": [ + "expect(response.body).to.not.have.property('errorInformation')" + ] + } + ] + } + }, + { + "id": 3, + "description": "Post Quote with wrong optional header - HTTP Method", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "headers": { + "Accept": "application/vnd.interoperability.quotes+json;version=1.0", + "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.fromFspId}", + "FSPIOP-HTTP-Method": "GET", + "FSPIOP-Destination": "{$inputs.fromFspId}" + }, + "body": { + "quoteId": "{$function.generic.generateUUID}", + "transactionId": "{$function.generic.generateUUID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.fromIdType}", + "partyIdentifier": "{$inputs.fromIdValue}", + "fspId": "{$inputs.fromFspId}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.fromFirstName}", + "lastName": "{$inputs.fromLastName}" + }, + "dateOfBirth": "{$inputs.fromDOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.toIdType}", + "partyIdentifier": "{$inputs.toIdValue}", + "fspId": "{$inputs.toFspId}" + } + }, + "amountType": "SEND", + "amount": { + "amount": "{$inputs.amount}", + "currency": "{$inputs.currency}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + }, + "note": "{$inputs.note}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": ["expect(response.status).to.equal(202)"] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": ["expect(response.statusText).to.equal('Accepted')"] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback body should contain transferAmount", + "exec": [ + "expect(callback.body).to.have.property('transferAmount')" + ] + }, + { + "id": 6, + "description": "Callback transferAmount (amount & currency)to match the request", + "exec": [ + "expect(callback.body.transferAmount.amount).to.equal('{$request.body.amount.amount}')", + "expect(callback.body.transferAmount.currency).to.equal('{$request.body.amount.currency}')" + ] + }, + { + "id": 7, + "description": "Callback content-type to be quotes", + "exec": [ + "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.quotes+json;version=1.0')" + ] + }, + { + "id": 8, + "description": "Request amountType to be SEND", + "exec": [ + "expect('{$request.body.amountType}').to.equal('SEND')" + ] + }, + { + "id": 9, + "description": "Request transactionType scenario to be TRANSFER", + "exec": [ + "expect('{$request.body.transactionType.scenario}').to.equal('TRANSFER')" + ] + }, + { + "id": 10, + "description": "Request transactionType initiator to be PAYER", + "exec": [ + "expect('{$request.body.transactionType.initiator}').to.equal('PAYER')" + ] + }, + { + "id": 11, + "description": "Request transactionType initiatorType to be CONSUMER", + "exec": [ + "expect('{$request.body.transactionType.initiatorType}').to.equal('CONSUMER')" + ] + }, + { + "id": 12, + "description": "Response should not have error information", + "exec": [ + "expect(response.body).to.not.have.property('errorInformation')" + ] + } + ] + } + } + ] + } + ] +} From f369dec2484b112070fe04ca90cba7218b8b31fd Mon Sep 17 00:00:00 2001 From: amtryingmybest Date: Wed, 30 Apr 2025 13:46:14 +0300 Subject: [PATCH 2/2] feat:update quotes_negative tests --- .../hub/golden_path/negative_scenarios/quotes_negative.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collections/hub/golden_path/negative_scenarios/quotes_negative.json b/collections/hub/golden_path/negative_scenarios/quotes_negative.json index 7f0dcdee..3e23923a 100644 --- a/collections/hub/golden_path/negative_scenarios/quotes_negative.json +++ b/collections/hub/golden_path/negative_scenarios/quotes_negative.json @@ -856,14 +856,14 @@ "id": 5, "description": "Response should contain Accept", "exec": [ - "expect(response.body.errorInformation.errorDescription).to.include('Accept')" + "expect(response.body.errorInformation.errorDescription).to.include('accept')" ] }, { "id": 6, "description": "Response should contain '3101'", "exec": [ - "expect(response.body.errorInformation.errorCode).to.include('3001')" + "expect(response.body.errorInformation.errorCode).to.include('3101')" ] } ]