From 90c20cfd1489fc76a5d3b464ccd7f1cfd79bdb45 Mon Sep 17 00:00:00 2001 From: Apurb Rajdhan <103931815+apurbraj@users.noreply.github.com> Date: Tue, 11 Jun 2024 19:34:12 +0530 Subject: [PATCH 01/15] Update docker url and default branch name --- .circleci/config.yml | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index aa89477fd..46f1613a3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ orbs: helm: circleci/helm@2.0.1 aws-eks: circleci/aws-eks@2.2.0 kubernetes: circleci/kubernetes@1.3 - mifos-orb: mifos/docker-image-availability-check-and-upgrade@1.0.2 + fynarfin-orb: fynarfin/docker-image-availability-check-and-upgrade@1.0.2 executors: docker-executor: docker: @@ -51,18 +51,18 @@ jobs: IMAGE_TAG=$CIRCLE_TAG # Check if the Docker image with the same tag already exists in Docker Hub - if curl -s -f -u "$DOCKERHUB_USERNAME":"$DOCKERHUB_PASSWORD" "https://hub.docker.com/v2/repositories/openmf/ph-ee-integration-test/tags/$IMAGE_TAG" > /dev/null; then + if curl -s -f -u "$DOCKERHUB_USERNAME":"$DOCKERHUB_PASSWORD" "https://hub.docker.com/v2/repositories/fynarfin/ph-ee-integration-test/tags/$IMAGE_TAG" > /dev/null; then echo "Skipping the build and push as the tag $IMAGE_TAG already exists in Docker Hub." exit 0 fi # Build and tag the Docker image ./gradlew bootJar - docker build -t "openmf/ph-ee-integration-test:$IMAGE_TAG" . + docker build -t "fynarfin/ph-ee-integration-test:$IMAGE_TAG" . # Push the Docker image to Docker Hub docker login -u "$DOCKERHUB_USERNAME" -p "$DOCKERHUB_PASSWORD" - docker push "openmf/ph-ee-integration-test:$IMAGE_TAG" + docker push "fynarfin/ph-ee-integration-test:$IMAGE_TAG" # when: always # The job will be executed even if there's no match for the tag filter @@ -84,13 +84,13 @@ jobs: ./gradlew checkstyleMain ./gradlew checkstyleTest ./gradlew bootJar - docker build -t openmf/ph-ee-integration-test:latest . - if [ "$CIRCLE_BRANCH" != "master" ]; then + docker build -t fynarfin/ph-ee-integration-test:latest . + if [ "$CIRCLE_BRANCH" != "develop" ]; then PR_NUMBER=$(basename $CIRCLE_PULL_REQUEST) - PR_TITLE=$(curl -sSL "https://api.github.com/repos/openmf/$CIRCLE_PR_REPONAME/pulls/$PR_NUMBER" | jq -r '.title') + PR_TITLE=$(curl -sSL "https://api.github.com/repos/fynarfin/$CIRCLE_PR_REPONAME/pulls/$PR_NUMBER" | jq -r '.title') JIRA_STORY=$(echo $PR_TITLE | cut -d "[" -f2 | cut -d "]" -f1 | tr '[A-Z]' '[a-z]') if [ -z "$JIRA_STORY" ]; then echo "Invalid PR title" && exit 1; else echo "Ticket NO: $JIRA_STORY"; fi - docker image tag openmf/ph-ee-integration-test:latest openmf/ph-ee-integration-test:$JIRA_STORY + docker image tag fynarfin/ph-ee-integration-test:latest fynarfin/ph-ee-integration-test:$JIRA_STORY fi # Log in to DockerHub using environment variables @@ -102,20 +102,20 @@ jobs: - run: name: Push Docker image to DockerHub command: | - if [ "$CIRCLE_BRANCH" = "master" ]; then - docker push openmf/ph-ee-integration-test:latest + if [ "$CIRCLE_BRANCH" = "develop" ]; then + docker push fynarfin/ph-ee-integration-test:latest fi - if [ "$CIRCLE_BRANCH" != "master" ]; then + if [ "$CIRCLE_BRANCH" != "develop" ]; then PR_NUMBER=$(basename $CIRCLE_PULL_REQUEST) - PR_TITLE=$(curl -sSL "https://api.github.com/repos/openmf/$CIRCLE_PR_REPONAME/pulls/$PR_NUMBER" | jq -r '.title') + PR_TITLE=$(curl -sSL "https://api.github.com/repos/fynarfin/$CIRCLE_PR_REPONAME/pulls/$PR_NUMBER" | jq -r '.title') JIRA_STORY=$(echo $PR_TITLE | cut -d "[" -f2 | cut -d "]" -f1 | tr '[A-Z]' '[a-z]') - docker push openmf/ph-ee-integration-test:${JIRA_STORY} + docker push fynarfin/ph-ee-integration-test:${JIRA_STORY} fi docker-image-availability-check-and-upgrade: docker: - image: 'cimg/python:3.10' steps: - - mifos-orb/docker-image-availability-check-and-upgrade: + - fynarfin-orb/docker-image-availability-check-and-upgrade: namespace: paymenthub chart-base-url: https://fynarfin.io/images chart-name: ph-ee-g2psandbox-fynarfin @@ -123,7 +123,7 @@ jobs: release-name: g2p-sandbox cluster-name: "sit" aws-region: "$REGION" - service-file-path: https://raw.githubusercontent.com/openMF/ph-ee-env-labs/master/.circleci/services.txt + service-file-path: https://raw.githubusercontent.com/fynarfin/ph-ee-env-labs/develop/.circleci/services.txt create-tls-secret-paymenthub-namespace: docker: @@ -158,7 +158,7 @@ jobs: - setup_remote_docker: version: 20.10.14 - kubernetes/install-kubectl - - run: git clone https://github.com/openmf/ph-ee-env-labs + - run: git clone https://github.com/fynarfin/ph-ee-env-labs - aws-eks/update-kubeconfig-with-authenticator: cluster-name: "sit" aws-region: "$REGION" @@ -187,7 +187,7 @@ jobs: docker: - image: 'cimg/base:2022.06' steps: - - run: git clone https://github.com/openmf/ph-ee-env-labs + - run: git clone https://github.com/fynarfin/ph-ee-env-labs - run: echo $AWS_PROFILE - run: echo $AWS_DEFAULT_PROFILE - run: | @@ -202,7 +202,7 @@ jobs: - image: cimg/openjdk:17.0.0-node steps: - checkout - #- run: git clone https://github.com/openmf/ph-ee-integration-test + #- run: git clone https://github.com/fynarfin/ph-ee-integration-test - run: name: Ngrok setup command: curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null && echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list && sudo apt update && sudo apt install ngrok @@ -231,7 +231,7 @@ jobs: echo -n "Test execution is completed, kill ngrok" pkill ngrok - store_test_results: - path: build/test-results/test/TEST-org.mifos.integrationtest.TestRunner.xml + path: build/test-results/test/TEST-org.fynarfin.integrationtest.TestRunner.xml - store_artifacts: path: build/test-results test-chart-ams: @@ -239,7 +239,7 @@ jobs: - image: cimg/openjdk:17.0.0 steps: - checkout - #- run: git clone https://github.com/openmf/ph-ee-integration-test + #- run: git clone https://github.com/fynarfin/ph-ee-integration-test - run: name: Ngrok setup command: curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null && echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list && sudo apt update && sudo apt install ngrok @@ -268,7 +268,7 @@ jobs: echo -n "Test execution is completed, kill ngrok" pkill ngrok - store_test_results: - path: build/test-results/test/TEST-org.mifos.integrationtest.TestRunner.xml + path: build/test-results/test/TEST-org.fynarfin.integrationtest.TestRunner.xml - store_artifacts: path: build/test-results workflows: From 9d430599d17456cc1b09e27b9b5b1065a8181c15 Mon Sep 17 00:00:00 2001 From: Apurb Rajdhan <103931815+apurbraj@users.noreply.github.com> Date: Tue, 11 Jun 2024 19:36:21 +0530 Subject: [PATCH 02/15] Update orb version --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 46f1613a3..8cfcb0bc9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ orbs: helm: circleci/helm@2.0.1 aws-eks: circleci/aws-eks@2.2.0 kubernetes: circleci/kubernetes@1.3 - fynarfin-orb: fynarfin/docker-image-availability-check-and-upgrade@1.0.2 + fynarfin-orb: fynarfin/docker-image-availability-check-and-upgrade@1.0.1 executors: docker-executor: docker: From 2a9384ace040910f954e4e7d3be7934f501eaa26 Mon Sep 17 00:00:00 2001 From: Apurb Rajdhan <103931815+apurbraj@users.noreply.github.com> Date: Fri, 21 Jun 2024 16:34:00 +0530 Subject: [PATCH 03/15] Update orb image --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8cfcb0bc9..7d0bf87ec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ orbs: helm: circleci/helm@2.0.1 aws-eks: circleci/aws-eks@2.2.0 kubernetes: circleci/kubernetes@1.3 - fynarfin-orb: fynarfin/docker-image-availability-check-and-upgrade@1.0.1 + fynarfin-orb: fynarfin/docker-image-availability-check-and-upgrade@1.0.2 executors: docker-executor: docker: @@ -87,7 +87,7 @@ jobs: docker build -t fynarfin/ph-ee-integration-test:latest . if [ "$CIRCLE_BRANCH" != "develop" ]; then PR_NUMBER=$(basename $CIRCLE_PULL_REQUEST) - PR_TITLE=$(curl -sSL "https://api.github.com/repos/fynarfin/$CIRCLE_PR_REPONAME/pulls/$PR_NUMBER" | jq -r '.title') + PR_TITLE=$(curl -sSL "https://api.github.com/repos/fynarfin/$CIRCLE_PROJECT_REPONAME/pulls/$PR_NUMBER" | jq -r '.title') JIRA_STORY=$(echo $PR_TITLE | cut -d "[" -f2 | cut -d "]" -f1 | tr '[A-Z]' '[a-z]') if [ -z "$JIRA_STORY" ]; then echo "Invalid PR title" && exit 1; else echo "Ticket NO: $JIRA_STORY"; fi docker image tag fynarfin/ph-ee-integration-test:latest fynarfin/ph-ee-integration-test:$JIRA_STORY @@ -107,7 +107,7 @@ jobs: fi if [ "$CIRCLE_BRANCH" != "develop" ]; then PR_NUMBER=$(basename $CIRCLE_PULL_REQUEST) - PR_TITLE=$(curl -sSL "https://api.github.com/repos/fynarfin/$CIRCLE_PR_REPONAME/pulls/$PR_NUMBER" | jq -r '.title') + PR_TITLE=$(curl -sSL "https://api.github.com/repos/fynarfin/$CIRCLE_PROJECT_REPONAME/pulls/$PR_NUMBER" | jq -r '.title') JIRA_STORY=$(echo $PR_TITLE | cut -d "[" -f2 | cut -d "]" -f1 | tr '[A-Z]' '[a-z]') docker push fynarfin/ph-ee-integration-test:${JIRA_STORY} fi From 7034d06e2ebe3561c5a2295ce81f63124ac2f20b Mon Sep 17 00:00:00 2001 From: Apurb Rajdhan <103931815+apurbraj@users.noreply.github.com> Date: Fri, 21 Jun 2024 17:23:36 +0530 Subject: [PATCH 04/15] Update fynarfin image url --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7d0bf87ec..8442e19cb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -117,7 +117,7 @@ jobs: steps: - fynarfin-orb/docker-image-availability-check-and-upgrade: namespace: paymenthub - chart-base-url: https://fynarfin.io/images + chart-base-url: https://fynarfin.io/images/fynarfin chart-name: ph-ee-g2psandbox-fynarfin chart-version: 0.2.0 release-name: g2p-sandbox From 6a288742c41114c0d35b6cd8591141468be9bfac Mon Sep 17 00:00:00 2001 From: logoutdhaval Date: Tue, 2 Jul 2024 00:40:22 +0530 Subject: [PATCH 05/15] [PHEE-693] Fix Loan account Creation Test for fineract 1.9.0 --- build.gradle | 2 +- .../integrationtest/cucumber/stepdef/GSMATransferDef.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index dfdc50234..953ade48b 100644 --- a/build.gradle +++ b/build.gradle @@ -166,7 +166,7 @@ dependencies { checkstyle 'com.github.sevntu-checkstyle:sevntu-checks:1.44.1' implementation 'com.diffplug.gradle.spotless:spotless:2.4.1' implementation 'com.diffplug.spotless:spotless-plugin-gradle:6.17.0' - implementation 'org.mifos:openapi-java-client:2.0.3-SNAPSHOT' + implementation 'org.mifos:openapi-java-client:2.0.4-SNAPSHOT' testImplementation 'org.hamcrest:hamcrest:2.2' implementation 'com.opencsv:opencsv:5.5.2' testImplementation 'org.apache.commons:commons-csv:1.5' diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferDef.java index 84a0f4e32..d933124c1 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferDef.java @@ -128,7 +128,7 @@ protected String setBodyLoanProduct() throws JsonProcessingException { loanProductsRequest.setInterestType(1); loanProductsRequest.setInterestRatePerPeriod(19.0); loanProductsRequest.setRepaymentEvery(1); - loanProductsRequest.setTransactionProcessingStrategyId(1); + loanProductsRequest.setTransactionProcessingStrategyCode("mifos-standard-strategy"); loanProductsRequest.setAmortizationType(1); loanProductsRequest.setAccountingRule(1); loanProductsRequest.setInterestRateFrequencyType(2); @@ -162,7 +162,7 @@ protected String setBodyLoanAccount() throws JsonProcessingException { loanAccountData.setAmortizationType(1); loanAccountData.setInterestType(0); loanAccountData.setInterestCalculationPeriodType(0); - loanAccountData.setTransactionProcessingStrategyId(1); + loanAccountData.setTransactionProcessingStrategyCode("mifos-standard-strategy"); loanAccountData.setLocale("en"); loanAccountData.setDateFormat("dd MMMM yyyy"); loanAccountData.setLoanType("individual"); From 09c0da9d39ea1b1ea762311d7c236a85b3d5d179 Mon Sep 17 00:00:00 2001 From: Anover000 <140409886+Anover000@users.noreply.github.com> Date: Wed, 10 Jul 2024 14:33:45 +0530 Subject: [PATCH 06/15] [PHEE-699] Parallel Payee-Multi-Tenancy-Support in channel Transfer API (#10) * Enable testing for Multi Payee Tenant support for PayerFundTransfer. * Update transfer header value. * Incorporate multiple payee Fps in Mojaloop setup steps. * Update test Scenario to Scenario Outline to run tests will all 3 payees. --- .../config/MojaloopConfig.java | 8 ++++- .../config/PayerFundTransferConfig.java | 8 ++++- src/main/resources/application.yaml | 8 +++-- .../cucumber/stepdef/MojaloopDef.java | 4 +++ .../cucumber/stepdef/MojaloopStepDef.java | 33 +++++++++++++++---- .../stepdef/PayerFundTransferStepDef.java | 27 ++++++++++----- src/test/java/resources/mojaloop.feature | 13 ++++++-- 7 files changed, 79 insertions(+), 22 deletions(-) diff --git a/src/main/java/org/mifos/integrationtest/config/MojaloopConfig.java b/src/main/java/org/mifos/integrationtest/config/MojaloopConfig.java index 129912a84..61dd4b77a 100644 --- a/src/main/java/org/mifos/integrationtest/config/MojaloopConfig.java +++ b/src/main/java/org/mifos/integrationtest/config/MojaloopConfig.java @@ -42,9 +42,15 @@ public class MojaloopConfig { @Value("${mojaloop.fspid.payer}") public String payerFspId; - @Value("${mojaloop.fspid.payee}") + @Value("${mojaloop.fspid.payee1}") public String payeeFspId; + @Value("${mojaloop.fspid.payee2}") + public String payeeFspId2; + + @Value("${mojaloop.fspid.payee3}") + public String payeeFspId3; + @Value("${ml-connector.host}") public String mlConnectorHost; diff --git a/src/main/java/org/mifos/integrationtest/config/PayerFundTransferConfig.java b/src/main/java/org/mifos/integrationtest/config/PayerFundTransferConfig.java index 353670ce6..f8965c5de 100644 --- a/src/main/java/org/mifos/integrationtest/config/PayerFundTransferConfig.java +++ b/src/main/java/org/mifos/integrationtest/config/PayerFundTransferConfig.java @@ -9,9 +9,15 @@ public class PayerFundTransferConfig { @Value("${payerFundTransfer.tenant.payer}") public String payerTenant; - @Value("${payerFundTransfer.tenant.payee}") + @Value("${payerFundTransfer.tenant.payee1}") public String payeeTenant; + @Value("${payerFundTransfer.tenant.payee2}") + public String payeeTenant2; + + @Value("${payerFundTransfer.tenant.payee3}") + public String payeeTenant3; + @Value("${savings.base-url}") public String clientBaseUrl; @Value("${savings.endpoints.client-endpoint}") diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index cb7987fb7..07386015a 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -186,12 +186,16 @@ config: payerFundTransfer: tenant: payer: "wakanda" - payee: "jupiter" + payee1: "jupiter" + payee2: "pluto" + payee3: "venus" mojaloop: fspid: payer: "payerfsp" - payee: "payeefsp" + payee1: "payeefsp" + payee2: "payeefsp2" + payee3: "payeefsp3" contactpoint: http://account-lookup-service.sandbox.fynarfin.io central-ledger-contactpoint: http://central-ledger.sandbox.fynarfin.io account-lookup-admin-contactpoint: http://account-lookup-service-admin.sandbox.fynarfin.io diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopDef.java index f0e02d30e..cbb0ede07 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopDef.java @@ -195,11 +195,15 @@ protected void setCallbackEndpoints() { String payerFsp = mojaloopConfig.payerFspId; String payeeFsp = mojaloopConfig.payeeFspId; + String payeeFsp2 = mojaloopConfig.payeeFspId2; + String payeeFsp3 = mojaloopConfig.payeeFspId3; callbackEndpoints.getCallbackEndpoints().forEach(callback -> { String value = callback.getValue().replaceAll("\\{\\{CALLBACK_HOST\\}\\}", "http://" + mojaloopConfig.mlConnectorHost); try { addCallbackEndpoint(payerFsp, callback.getType(), value); addCallbackEndpoint(payeeFsp, callback.getType(), value); + addCallbackEndpoint(payeeFsp2, callback.getType(), value); + addCallbackEndpoint(payeeFsp3, callback.getType(), value); } catch (JsonProcessingException e) { throw new RuntimeException(e); } diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java index 32dbf07d6..9209182b6 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java @@ -29,12 +29,23 @@ public void addUsersToALS(String client) throws JsonProcessingException { String clientIdentifierId; String fspId; - if (client.equals("payer")) { - clientIdentifierId = scenarioScopeState.payerIdentifier; - fspId = mojaloopConfig.payerFspId; - } else { - clientIdentifierId = scenarioScopeState.payeeIdentifier; - fspId = mojaloopConfig.payeeFspId; + switch (client) { + case "payer" -> { + clientIdentifierId = scenarioScopeState.payerIdentifier; + fspId = mojaloopConfig.payerFspId; + } + case "payee2" -> { + clientIdentifierId = scenarioScopeState.payeeIdentifier; + fspId = mojaloopConfig.payeeFspId2; + } + case "payee3" -> { + clientIdentifierId = scenarioScopeState.payeeIdentifier; + fspId = mojaloopConfig.payeeFspId3; + } + default -> { + clientIdentifierId = scenarioScopeState.payeeIdentifier; + fspId = mojaloopConfig.payeeFspId; + } } RequestSpecification requestSpec = Utils.getDefaultSpec(); @@ -67,6 +78,9 @@ public void mojaloopSetup() throws JsonProcessingException { String payerFsp = mojaloopConfig.payerFspId; String payeeFsp = mojaloopConfig.payeeFspId; + String payeeFsp2 = mojaloopConfig.payeeFspId2; + String payeeFsp3 = mojaloopConfig.payeeFspId3; + if (!mojaloopDef.isHubAccountTypesAdded()) { @@ -86,10 +100,15 @@ public void mojaloopSetup() throws JsonProcessingException { mojaloopDef.addFsp(payerFsp); mojaloopDef.addFsp(payeeFsp); + mojaloopDef.addFsp(payeeFsp2); + mojaloopDef.addFsp(payeeFsp3); mojaloopDef.addInitialPositionAndLimit(payerFsp); mojaloopDef.addInitialPositionAndLimit(payeeFsp); + mojaloopDef.addInitialPositionAndLimit(payeeFsp2); + mojaloopDef.addInitialPositionAndLimit(payeeFsp3); - if (!mojaloopDef.getCallbackEndpoints(payerFsp) || !mojaloopDef.getCallbackEndpoints(payeeFsp)) { + if (!mojaloopDef.getCallbackEndpoints(payerFsp) || !mojaloopDef.getCallbackEndpoints(payeeFsp) || !mojaloopDef.getCallbackEndpoints(payeeFsp2) + || !mojaloopDef.getCallbackEndpoints(payeeFsp3)) { mojaloopDef.setCallbackEndpoints(); } diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java index 3da9ae9f7..9926590ae 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java @@ -66,15 +66,25 @@ public class PayerFundTransferStepDef extends BaseStepDef { public void setTenantForPayer(String client) { String tenant; logger.info(client); - if (client.equals("payer")) { - tenant = transferConfig.payerTenant; - fundTransferDef.setPayerTenant(tenant); - scenarioScopeState.tenant = tenant; - } else { - tenant = transferConfig.payeeTenant; - fundTransferDef.setPayeeTenant(tenant); - scenarioScopeState.tenant = tenant; + switch (client) { + case "payer" -> { + tenant = transferConfig.payerTenant; + fundTransferDef.setPayerTenant(tenant); + } + case "payee2" -> { + tenant = transferConfig.payeeTenant2; + fundTransferDef.setPayeeTenant(tenant); + } + case "payee3" -> { + tenant = transferConfig.payeeTenant3; + fundTransferDef.setPayeeTenant(tenant); + } + default -> { + tenant = transferConfig.payeeTenant; + fundTransferDef.setPayeeTenant(tenant); + } } + scenarioScopeState.tenant = tenant; assertThat(tenant).isNotEmpty(); fundTransferDef.setTenant(tenant); logger.info(tenant); @@ -396,6 +406,7 @@ public void payerFundTransfer(String amount) throws JSONException { RequestSpecification requestSpec = Utils.getDefaultSpec(transferConfig.payerTenant); requestSpec.header(Utils.X_CORRELATIONID, UUID.randomUUID()); + requestSpec.header("X-PayeeDFSP-ID", fundTransferDef.payeeTenant); // requestSpec.header("Platform-TenantId", transferConfig.payerTenant); String requestBody = TransferHelper diff --git a/src/test/java/resources/mojaloop.feature b/src/test/java/resources/mojaloop.feature index 3cae45cf8..d88be4fe2 100644 --- a/src/test/java/resources/mojaloop.feature +++ b/src/test/java/resources/mojaloop.feature @@ -56,7 +56,7 @@ Feature: Mojaloop test Then I should be able to verify the callback for transfer Then I can stop mock server - Scenario: Payer Fund Transfer Flow test + Scenario Outline: Payer Fund Transfer Flow test Given I am setting up Mojaloop Given I have Fineract-Platform-TenantId for "payer" When I call the create client endpoint for "payer" @@ -67,7 +67,8 @@ Feature: Mojaloop test When I activate the account with command "activate" for "payer" Then I call the deposit account endpoint with command "deposit" for amount 12 for "payer" - Given I have Fineract-Platform-TenantId for "payee" +# payee1/payee2/payee3 + Given I have Fineract-Platform-TenantId for "" When I call the create client endpoint for "payee" Then I call the create savings product endpoint for "payee" When I call the create savings account endpoint for "payee" @@ -77,7 +78,8 @@ Feature: Mojaloop test Then I call the deposit account endpoint with command "deposit" for amount 10 for "payee" Then I add "payer" to als - Then I add "payee" to als +# payee1/payee2/payee3 + Then I add "" to als Then I call the payer fund transfer api to transfer amount "1" from payer to payee Then I should get transaction id in response @@ -100,6 +102,11 @@ Feature: Mojaloop test Then I assert "payer" balance to be 11 Then I assert "payee" balance to be 11 + Examples: + | payee | + | payee1 | + | payee2 | + | payee3 | Scenario: Bulk Transfer with Mojaloop Given I am setting up Mojaloop From 56981fa872fd42091fff432c75f77aa818f9ed0b Mon Sep 17 00:00:00 2001 From: Abhinav Mishra Date: Wed, 3 Jul 2024 11:29:56 +0530 Subject: [PATCH 07/15] Demo TCS with Account Registration --- .../cucumber/stepdef/BatchApiStepDef.java | 1 - .../stepdef/IdentityMapperStepDef.java | 17 +++ .../cucumber/stepdef/MojaloopStepDef.java | 39 +++++ .../stepdef/PayerFundTransferStepDef.java | 109 ++++++++++++++ src/test/java/resources/batch.feature | 4 +- .../batch_demo_csv/batchTransaction.csv | 4 + src/test/java/resources/bulkPayment.feature | 140 +++++++++++++++++- 7 files changed, 310 insertions(+), 4 deletions(-) create mode 100644 src/test/java/resources/batch_demo_csv/batchTransaction.csv diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/BatchApiStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/BatchApiStepDef.java index 5b6296d53..174697c6a 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/BatchApiStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/BatchApiStepDef.java @@ -311,7 +311,6 @@ public void callBatchTransactionsEndpoint(int expectedStatus) { RequestSpecification requestSpec = Utils.getDefaultSpec(scenarioScopeState.tenant, scenarioScopeState.clientCorrelationId); requestSpec.header(HEADER_PURPOSE, "Integartion test"); requestSpec.header(HEADER_FILENAME, scenarioScopeState.filename); - requestSpec.header(HEADER_REGISTERING_INSTITUTE_ID, "SocialWelfare"); requestSpec.queryParam(QUERY_PARAM_TYPE, "CSV"); requestSpec.header(QUERY_PARAM_TYPE, "CSV"); if (scenarioScopeState.signature != null && !scenarioScopeState.signature.isEmpty()) { diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/IdentityMapperStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/IdentityMapperStepDef.java index 862071084..6f864c702 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/IdentityMapperStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/IdentityMapperStepDef.java @@ -27,6 +27,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.UUID; import org.json.JSONArray; import org.json.JSONException; @@ -526,6 +527,22 @@ public void iCreateAIdentityMapperDTOForRegisteringBeneficiary() { registerBeneficiaryBody = new AccountMapperRequestDTO(requestId, sourceBBID, beneficiaryDTOList); } + @And("I create a IdentityMapperDTO for registering payee with IAM") + public void iCreateAIdentityMapperDTOForRegisteringPayee() { + List beneficiaryDTOList = new ArrayList<>(); + String payeeFsp = "payeefsp3"; + String[] financialAddressArray = { "1234", "1235", "1236" }; + int fspIndex = 0; + Set payeeIdentifiers = new HashSet<>(scenarioScopeState.payeeIdentifiers); + for (String payeeIdentifier : payeeIdentifiers) { + BeneficiaryDTO beneficiaryDTO = new BeneficiaryDTO(payeeIdentifier, "00", financialAddressArray[fspIndex], payeeFspConfig.getPayeeFsp(payeeFsp)); + beneficiaryDTOList.add(beneficiaryDTO); + fspIndex++; + } + requestId = generateUniqueNumber(12); + registerBeneficiaryBody = new AccountMapperRequestDTO(requestId, sourceBBID, beneficiaryDTOList); + } + @And("I should be able to verify that the {string} method to {string} endpoint received a request with successfull registration") public void iShouldBeAbleToVerifyThatTheMethodToEndpointReceivedARequestWithSuccessfullRegistration(String httpMethod, String stub) { await().atMost(awaitMost, SECONDS).untilAsserted(() -> { diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java index 9209182b6..38c7a521a 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java @@ -73,6 +73,45 @@ public void addUsersToALS(String client) throws JsonProcessingException { assertThat(response).isNotNull(); } + @Then("I add {string} with account id {string} to als") + public void addBudgetAccountToALS(String client, String accountId) throws JsonProcessingException { + + String clientIdentifierId; + String fspId; + if (client.equals("payer")) { + clientIdentifierId = scenarioScopeState.payerIdentifier; + fspId = mojaloopConfig.payerFspId; + } else { + clientIdentifierId = scenarioScopeState.payeeIdentifier; + fspId = mojaloopConfig.payeeFspId; + } + + RequestSpecification requestSpec = Utils.getDefaultSpec(); + requestSpec.header("FSPIOP-Source", fspId); + requestSpec.header("Date", getCurrentDateInFormat()); + requestSpec.header("Accept", "application/vnd.interoperability.participants+json;version=1"); + // requestSpec.header("Content-Type", "application/vnd.interoperability.participants+json;version=1.0"); + + String endpoint = mojaloopConfig.addUserToAlsEndpoint; + endpoint = endpoint.replaceAll("\\{\\{identifierType\\}\\}", "MSISDN"); + endpoint = endpoint.replaceAll("\\{\\{identifier\\}\\}", accountId); + + String requestBody = mojaloopDef.setBodyAddAlsUser(fspId); + + logger.info(mojaloopConfig.mojaloopBaseurl); + logger.info(requestBody); + logger.info(endpoint); + + String response = RestAssured.given(requestSpec).baseUri(mojaloopConfig.mojaloopBaseurl) + .config(RestAssured.config().encoderConfig(encoderConfig().appendDefaultContentCharsetToContentTypeIfUndefined(false))) + .body(requestBody).contentType("application/vnd.interoperability.participants+json;version=1.0").expect() + .spec(new ResponseSpecBuilder().expectStatusCode(202).build()).when().post(endpoint).andReturn().asString(); + + logger.info(response); + assertThat(response).isNotNull(); + } + + @Given("I am setting up Mojaloop") public void mojaloopSetup() throws JsonProcessingException { diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java index 9926590ae..3b44d3856 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java @@ -42,6 +42,8 @@ public class PayerFundTransferStepDef extends BaseStepDef { private static String payer_identifier; + private static String savings_account_id; + private static String payee_identifier; private static String quoteId; @@ -186,6 +188,42 @@ public void callCreateInteropIdentifierEndpoint(String client) throws JsonProces assertThat(fundTransferDef.responseInteropIdentifier).isNotEmpty(); } + @Then("I call the interop identifier endpoint for {string} and accountId {string}") + public void callCreateInteropBudgetIdentifierEndpoint(String client, String accountId) throws JsonProcessingException { + // Setting headers and body + RequestSpecification requestSpec = Utils.getDefaultSpec(); + requestSpec = fundTransferDef.setHeaders(requestSpec); + fundTransferDef.interopIdentifierBody = fundTransferDef.setBodyInteropIdentifier(); + // Setting account ID in path + + String responseSavingsAccount = client.equals("payer") ? fundTransferDef.responseSavingsAccountPayer + : fundTransferDef.responseSavingsAccountPayee; + + PostSavingsAccountsResponse savingsAccountResponse = objectMapper.readValue(responseSavingsAccount, + PostSavingsAccountsResponse.class); + savings_account_id = savingsAccountResponse.getSavingsId().toString(); + + if (client.equals("payer")) { + payer_identifier = accountId; + scenarioScopeState.payerIdentifier = accountId; + } else { + payee_identifier = accountId; + scenarioScopeState.payeeIdentifier = accountId; + } + + String endpoint = transferConfig.interopIdentifierEndpoint; + endpoint = endpoint.replaceAll("\\{\\{identifierType\\}\\}", "MSISDN"); + endpoint = endpoint.replaceAll("\\{\\{identifier\\}\\}", accountId); + + // Calling Interop Identifier endpoint + fundTransferDef.responseInteropIdentifier = RestAssured.given(requestSpec).baseUri(transferConfig.savingsBaseUrl) + .body(fundTransferDef.interopIdentifierBody).expect().spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when() + .post(endpoint).andReturn().asString(); + + logger.info("Interop Identifier Response: " + fundTransferDef.responseInteropIdentifier); + assertThat(fundTransferDef.responseInteropIdentifier).isNotEmpty(); + } + @Then("I approve the deposit with command {string} for {string}") public void callApproveSavingsEndpoint(String command, String client) throws JsonProcessingException { // Setting headers and body @@ -210,6 +248,31 @@ public void callApproveSavingsEndpoint(String command, String client) throws Jso assertThat(fundTransferDef.responseSavingsApprove).isNotEmpty(); } + @Then("I approve the deposit for Budget Account with command {string} for {string}") + public void callApproveBudgetAccountEndpoint(String command, String client) throws JsonProcessingException { + // Setting headers and body + RequestSpecification requestSpec = Utils.getDefaultSpec(); + requestSpec = fundTransferDef.setHeaders(requestSpec); + requestSpec.queryParam("command", command); + fundTransferDef.savingsApproveBody = fundTransferDef.setBodySavingsApprove(); + String endpoint = transferConfig.savingsApproveEndpoint; + + if (client.equals("payer")) { + endpoint = endpoint.replaceAll("\\{\\{savingsAccId\\}\\}", savings_account_id); + } else { + endpoint = endpoint.replaceAll("\\{\\{savingsAccId\\}\\}", savings_account_id); + } + + // Calling create loan account endpoint + fundTransferDef.responseSavingsApprove = RestAssured.given(requestSpec).baseUri(transferConfig.savingsBaseUrl) + .body(fundTransferDef.savingsApproveBody).expect().spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when() + .post(endpoint).andReturn().asString(); + + logger.info("Savings Approve Response: " + fundTransferDef.responseSavingsApprove); + assertThat(fundTransferDef.responseSavingsApprove).isNotEmpty(); + } + + @When("I activate the account with command {string} for {string}") public void callSavingsActivateEndpoint(String command, String client) throws JsonProcessingException { // Setting headers and body @@ -233,6 +296,30 @@ public void callSavingsActivateEndpoint(String command, String client) throws Js assertThat(fundTransferDef.responseSavingsActivate).isNotEmpty(); } + @When("I activate the budget account with command {string} for {string}") + public void callBudgetAccountActivateEndpoint(String command, String client) throws JsonProcessingException { + // Setting headers and body + RequestSpecification requestSpec = Utils.getDefaultSpec(); + requestSpec = fundTransferDef.setHeaders(requestSpec); + requestSpec.queryParam("command", command); + fundTransferDef.savingsActivateBody = fundTransferDef.setBodySavingsActivate(); + + String endpoint = transferConfig.savingsActivateEndpoint; + if (client.equals("payer")) { + endpoint = endpoint.replaceAll("\\{\\{savingsAccId\\}\\}", savings_account_id); + } else { + endpoint = endpoint.replaceAll("\\{\\{savingsAccId\\}\\}", savings_account_id); + } + // Calling create loan account endpoint + fundTransferDef.responseSavingsActivate = RestAssured.given(requestSpec).baseUri(transferConfig.savingsBaseUrl) + .body(fundTransferDef.savingsActivateBody).expect().spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when() + .post(endpoint).andReturn().asString(); + + logger.info("Savings Activate Response: " + fundTransferDef.responseSavingsActivate); + assertThat(fundTransferDef.responseSavingsActivate).isNotEmpty(); + } + + @Then("I call the deposit account endpoint with command {string} for amount {int} for {string}") public void callDepositAccountEndpoint(String command, int amount, String client) throws JsonProcessingException { // Setting headers and body @@ -619,4 +706,26 @@ public void consolidatedPayeeCreationStepsForCombinedTestsCases(String client, S } } + @Then("I check whether budget account exists with accoundId {string}") + public void budgetAccountExistsWithAccoundId(String accountId) throws JsonProcessingException { + RequestSpecification requestSpec = Utils.getDefaultSpec(); + requestSpec = fundTransferDef.setHeaders(requestSpec); + // Setting account ID in path + + String endpoint = transferConfig.interopIdentifierEndpoint; + endpoint = endpoint.replaceAll("\\{\\{identifierType\\}\\}", "MSISDN"); + endpoint = endpoint.replaceAll("\\{\\{identifier\\}\\}", accountId); + try { + // Calling Interop Identifier endpoint + fundTransferDef.responseInteropIdentifier = RestAssured.given(requestSpec).baseUri(transferConfig.savingsBaseUrl) + .expect().spec(new ResponseSpecBuilder().build()).when() + .delete(endpoint).andReturn().asString(); + } catch (Exception e) { + logger.error("Error checking account existence: ", e); + throw new RuntimeException("Failed to check account existence", e); + } + logger.info("Interop Identifier Response: " + fundTransferDef.responseInteropIdentifier); + assertThat(fundTransferDef.responseInteropIdentifier).isNotEmpty(); + } + } diff --git a/src/test/java/resources/batch.feature b/src/test/java/resources/batch.feature index 7405897c2..702a5f355 100644 --- a/src/test/java/resources/batch.feature +++ b/src/test/java/resources/batch.feature @@ -149,8 +149,8 @@ Feature: Batch Details API test Scenario: BD-011 Batch test for payerIdentifier resolution using budgetAccount info Given I have tenant as "paymentBB2" And I have the demo csv file "payerIdentifier-resolution-using-budgetAccount.csv" - And I have the registeringInstituteId "123" - And I have the programId "SocialWelfare" + And I have the registeringInstituteId "SocialWelfare" + And I have the programId "Education" And I generate clientCorrelationId And I have private key And I generate signature diff --git a/src/test/java/resources/batch_demo_csv/batchTransaction.csv b/src/test/java/resources/batch_demo_csv/batchTransaction.csv new file mode 100644 index 000000000..18905bd4d --- /dev/null +++ b/src/test/java/resources/batch_demo_csv/batchTransaction.csv @@ -0,0 +1,4 @@ +id,request_id,payment_mode,payer_identifier_type,payer_identifier,payee_identifier_type,payee_identifier,amount,currency,note +0,ed6bf87e-4bda-44dc-be52-004e71438f0f,mojaloop,msisdn,345,msisdn,363,3,USD,Test Payee Payment +1,25ddc445-069a-417b-b62a-f5b952ac313e,mojaloop,msisdn,346,msisdn,363,2,USD,Test Payee Payment +2,0842d2df-0aec-4312-ada4-c3dd2be1ed80,mojaloop,msisdn,347,msisdn,364,1,USD,Test Payee Payment \ No newline at end of file diff --git a/src/test/java/resources/bulkPayment.feature b/src/test/java/resources/bulkPayment.feature index e137bb633..5618d88ff 100644 --- a/src/test/java/resources/bulkPayment.feature +++ b/src/test/java/resources/bulkPayment.feature @@ -1,7 +1,143 @@ @gov @ext Feature: Test ability to make payment to individual with bank account - Scenario: Input CSV file using the batch transaction API and poll batch summary API till we get completed status + Scenario: BB-001 Create Budget Account and Register Payee + Given I am setting up Mojaloop + And I have the registeringInstituteId "SocialWelfare" + And I have the programId "Education" + Given I have Fineract-Platform-TenantId for "payer" + When I call the create client endpoint for "payer" + Then I call the create savings product endpoint for "payer" + When I call the create savings account endpoint for "payer" + Then I check whether budget account exists with accoundId "123456789" + Then I call the interop identifier endpoint for "payer" and accountId "123456789" + Then I approve the deposit for Budget Account with command "approve" for "payer" + When I activate the budget account with command "activate" for "payer" + Then I call the deposit account endpoint with command "deposit" for amount 7000 for "payer" + #Registring account lookup + Then I add "payer" with account id "123456789" to als + + + When I call the create client endpoint for "payer" + Then I call the create savings product endpoint for "payer" + When I call the create savings account endpoint for "payer" + Then I check whether budget account exists with accoundId "223456789" + Then I call the interop identifier endpoint for "payer" and accountId "223456789" + Then I approve the deposit for Budget Account with command "approve" for "payer" + When I activate the budget account with command "activate" for "payer" + Then I call the deposit account endpoint with command "deposit" for amount 9000 for "payer" + Then I add "payer" with account id "123456789" to als + + + When I call the create client endpoint for "payer" + Then I call the create savings product endpoint for "payer" + When I call the create savings account endpoint for "payer" + Then I check whether budget account exists with accoundId "323456789" + Then I call the interop identifier endpoint for "payer" and accountId "323456789" + Then I approve the deposit for Budget Account with command "approve" for "payer" + When I activate the budget account with command "activate" for "payer" + Then I call the deposit account endpoint with command "deposit" for amount 9000 for "payer" + Then I add "payer" with account id "123456789" to als + + Given I have Fineract-Platform-TenantId for "payee" + When I call the create client endpoint for "payee" + Then I call the create savings product endpoint for "payee" + When I call the create savings account endpoint for "payee" + Then I check whether budget account exists with accoundId "1234" + Then I call the interop identifier endpoint for "payee" and accountId "1234" + Then I approve the deposit for Budget Account with command "approve" for "payee" + When I activate the budget account with command "activate" for "payee" + Then I call the deposit account endpoint with command "deposit" for amount 1000 for "payee" + Then I add "payee" with account id "400173110196" to als + + Given I have Fineract-Platform-TenantId for "payee" + When I call the create client endpoint for "payee" + Then I call the create savings product endpoint for "payee" + When I call the create savings account endpoint for "payee" + Then I check whether budget account exists with accoundId "1235" + Then I call the interop identifier endpoint for "payee" and accountId "1235" + Then I approve the deposit for Budget Account with command "approve" for "payee" + When I activate the budget account with command "activate" for "payee" + Then I call the deposit account endpoint with command "deposit" for amount 2000 for "payee" + Then I add "payee" with account id "400174120160" to als + + Given I have Fineract-Platform-TenantId for "payee" + When I call the create client endpoint for "payee" + Then I call the create savings product endpoint for "payee" + When I call the create savings account endpoint for "payee" + Then I check whether budget account exists with accoundId "400173110195" + Then I call the interop identifier endpoint for "payee" and accountId "400173110195" + Then I approve the deposit for Budget Account with command "approve" for "payee" + When I activate the budget account with command "activate" for "payee" + Then I call the deposit account endpoint with command "deposit" for amount 3000 for "payee" + Then I add "payee" with account id "400173110195" to als + + And I have the demo csv file "bulk_payment.csv" + When I can inject MockServer + Then I can start mock server + And I can register the stub with "/registerBeneficiary" endpoint for "PUT" request with status of 200 + And I create a list of payee identifiers from csv file + And I create a IdentityMapperDTO for registering payee with IAM + Then I call the register beneficiary API with expected status of 202 and stub "/registerBeneficiary" + And I should be able to verify that the "PUT" method to "/registerBeneficiary" endpoint received a request with successfull registration + + Scenario: BB-001 Input CSV file using the batch transaction API and poll batch summary API till we get completed status + Given I have tenant as "paymentbb1" + And I have the demo csv file "bulk_payment.csv" + And I create a list of payee identifiers from csv file + When I can inject MockServer + Then I can start mock server + And I can register the stub with "/registerBeneficiary" endpoint for "PUT" request with status of 200 + And I create a IdentityMapperDTO for registering beneficiary + Then I call the register beneficiary API with expected status of 202 and stub "/registerBeneficiary" + And I should be able to verify that the "PUT" method to "/registerBeneficiary" endpoint received a request with successfull registration + + And I create a new clientCorrelationId + And I have private key + And I generate signature + And I have the registeringInstituteId "SocialWelfare" + And I have the programId "Education" + + When I call the batch transactions endpoint with expected status of 202 + Then I should get non empty response + And I am able to parse batch transactions response + And I fetch batch ID from batch transaction API's response +# Then I will sleep for 10000 millisecond + Given I have tenant as "paymentbb1" + When I call the batch summary API with expected status of 200 with total 6 txns + Then I am able to parse batch summary response + And Status of transaction is "COMPLETED" + And I should have matching total txn count and successful txn count in response + + + Scenario: BB-002 Input CSV file using the batch transaction API and poll batch summary API till we get completed status + Given I have tenant as "paymentbb1" + And I have the demo csv file "bulk_payment.csv" + And I create a list of payee identifiers from csv file + When I can inject MockServer + Then I can start mock server + And I can register the stub with "/registerBeneficiary" endpoint for "PUT" request with status of 200 + And I create a IdentityMapperDTO for registering beneficiary + Then I call the register beneficiary API with expected status of 202 and stub "/registerBeneficiary" + And I should be able to verify that the "PUT" method to "/registerBeneficiary" endpoint received a request with successfull registration + And I create a new clientCorrelationId + And I have private key + And I generate signature + And I have the registeringInstituteId "SocialWelfare" + And I have programId "UnconditionalCashTransfer" + When I call the batch transactions endpoint with expected status of 202 + Then I should get non empty response + And I am able to parse batch transactions response + And I fetch batch ID from batch transaction API's response +# Then I will sleep for 10000 millisecond + Given I have tenant as "paymentbb1" + When I call the batch summary API with expected status of 200 with total 6 txns + Then I am able to parse batch summary response + And Status of transaction is "COMPLETED" + And I should have matching total txn count and successful txn count in response + + + Scenario: BB-003 Input CSV file using the batch transaction API and poll batch summary API till we get completed status Given I have tenant as "paymentbb1" And I have the demo csv file "bulk_payment.csv" And I create a list of payee identifiers from csv file @@ -14,6 +150,8 @@ Feature: Test ability to make payment to individual with bank account And I create a new clientCorrelationId And I have private key And I generate signature + And I have the registeringInstituteId "Health" + And I have programId "Maternity" When I call the batch transactions endpoint with expected status of 202 Then I should get non empty response And I am able to parse batch transactions response From 88f8daf258c542c2caf2baa94e6c18247f5cab97 Mon Sep 17 00:00:00 2001 From: Abhinav Mishra Date: Tue, 9 Jul 2024 18:08:27 +0530 Subject: [PATCH 08/15] Demo Script Test Cases --- src/main/resources/application.yaml | 2 + .../stepdef/IdentityMapperStepDef.java | 3 +- .../cucumber/stepdef/MojaloopStepDef.java | 23 +++++++--- .../stepdef/PayerFundTransferDef.java | 4 ++ .../stepdef/PayerFundTransferStepDef.java | 2 + .../batch_demo_csv/bulk_payment2.csv | 7 +++ src/test/java/resources/bulkPayment.feature | 43 ++++++++++--------- 7 files changed, 56 insertions(+), 28 deletions(-) create mode 100644 src/test/java/resources/batch_demo_csv/bulk_payment2.csv diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 07386015a..150db6fb5 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -186,6 +186,7 @@ config: payerFundTransfer: tenant: payer: "wakanda" + payee: "jupiter" payee1: "jupiter" payee2: "pluto" payee3: "venus" @@ -193,6 +194,7 @@ payerFundTransfer: mojaloop: fspid: payer: "payerfsp" + payee: "payeefsp" payee1: "payeefsp" payee2: "payeefsp2" payee3: "payeefsp3" diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/IdentityMapperStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/IdentityMapperStepDef.java index 6f864c702..24d290724 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/IdentityMapperStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/IdentityMapperStepDef.java @@ -25,6 +25,7 @@ import java.io.File; import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -75,7 +76,7 @@ public class IdentityMapperStepDef extends BaseStepDef { public void iCallTheRegisterBeneficiaryAPIWithExpectedStatusOf(int expectedStatus, String stub) { RequestSpecification requestSpec = Utils.getDefaultSpec(); scenarioScopeState.response = RestAssured.given(requestSpec).header("Content-Type", "application/json") - .header("X-Registering-Institution-ID", sourceBBID).header("X-CallbackURL", identityMapperConfig.callbackURL + stub) + .header("X-Registering-Institution-ID", scenarioScopeState.registeringInstituteId).header("X-CallbackURL", identityMapperConfig.callbackURL + stub) .baseUri(identityMapperConfig.identityMapperContactPoint).body(registerBeneficiaryBody).expect() .spec(new ResponseSpecBuilder().expectStatusCode(expectedStatus).build()).when() .post(identityMapperConfig.registerBeneficiaryEndpoint).andReturn().asString(); diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java index 38c7a521a..ff50e6ab4 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java @@ -78,12 +78,23 @@ public void addBudgetAccountToALS(String client, String accountId) throws JsonPr String clientIdentifierId; String fspId; - if (client.equals("payer")) { - clientIdentifierId = scenarioScopeState.payerIdentifier; - fspId = mojaloopConfig.payerFspId; - } else { - clientIdentifierId = scenarioScopeState.payeeIdentifier; - fspId = mojaloopConfig.payeeFspId; + switch (client) { + case "payer" -> { + clientIdentifierId = scenarioScopeState.payerIdentifier; + fspId = mojaloopConfig.payerFspId; + } + case "payee2" -> { + clientIdentifierId = scenarioScopeState.payeeIdentifier; + fspId = mojaloopConfig.payeeFspId2; + } + case "payee3" -> { + clientIdentifierId = scenarioScopeState.payeeIdentifier; + fspId = mojaloopConfig.payeeFspId3; + } + default -> { + clientIdentifierId = scenarioScopeState.payeeIdentifier; + fspId = mojaloopConfig.payeeFspId; + } } RequestSpecification requestSpec = Utils.getDefaultSpec(); diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferDef.java index 5a4c04263..d00c44a95 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferDef.java @@ -243,6 +243,10 @@ protected String setBodyClient(String client) throws JsonProcessingException { return setBodyPayerClient(); } else if (client.equals("payee")) { return setBodyPayeeClient(); + } else if (client.equals("payee2")) { + return setBodyPayeeClient(); + } else if (client.equals("payee3")) { + return setBodyPayeeClient(); } return client; } diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java index 3b44d3856..66d99fcff 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java @@ -224,6 +224,8 @@ public void callCreateInteropBudgetIdentifierEndpoint(String client, String acco assertThat(fundTransferDef.responseInteropIdentifier).isNotEmpty(); } + + @Then("I approve the deposit with command {string} for {string}") public void callApproveSavingsEndpoint(String command, String client) throws JsonProcessingException { // Setting headers and body diff --git a/src/test/java/resources/batch_demo_csv/bulk_payment2.csv b/src/test/java/resources/batch_demo_csv/bulk_payment2.csv new file mode 100644 index 000000000..69d14b641 --- /dev/null +++ b/src/test/java/resources/batch_demo_csv/bulk_payment2.csv @@ -0,0 +1,7 @@ +id,request_id,payment_mode,payer_identifier_type,payer_identifier,payee_identifier_type,payee_identifier,amount,currency,note +0,g1e22fe3-9740-4fba-97b6-78f43bfa7f2f,closedloop,accountNumber,003001003879112168,accountNumber,500173110196,840,USD,Test Payee Payment +1,72aa3ea4-e6f6-4880-877f-39f6ac4d052e,closedloop,accountNumber,003001003879112168,accountNumber,500174120160,242,USD,Test Payee Payment +2,f1e22fe3-9740-4fba-97b6-78f43bfa7f0f,closedloop,accountNumber,003001003879112168,accountNumber,500173110195,830,USD,Test Payee Payment +3,q1e22fe3-9740-4fba-97b6-78f43bfa7f2f,closedloop,accountNumber,003001003879112168,accountNumber,500173110196,740,USD,Test Payee Payment +4,a2aa3ea4-e6f6-4880-877f-39f6ac4d052e,closedloop,accountNumber,003001003879112168,accountNumber,500174120160,132,USD,Test Payee Payment +5,z1e22fe3-9740-4fba-97b6-78f43bfa7f0f,closedloop,accountNumber,003001003879112168,accountNumber,500173110195,730,USD,Test Payee Payment diff --git a/src/test/java/resources/bulkPayment.feature b/src/test/java/resources/bulkPayment.feature index 5618d88ff..91bb38be9 100644 --- a/src/test/java/resources/bulkPayment.feature +++ b/src/test/java/resources/bulkPayment.feature @@ -1,7 +1,7 @@ @gov @ext Feature: Test ability to make payment to individual with bank account - Scenario: BB-001 Create Budget Account and Register Payee + Scenario: BB-000 Create Budget Account and Register Payee Given I am setting up Mojaloop And I have the registeringInstituteId "SocialWelfare" And I have the programId "Education" @@ -26,7 +26,7 @@ Feature: Test ability to make payment to individual with bank account Then I approve the deposit for Budget Account with command "approve" for "payer" When I activate the budget account with command "activate" for "payer" Then I call the deposit account endpoint with command "deposit" for amount 9000 for "payer" - Then I add "payer" with account id "123456789" to als + Then I add "payer" with account id "223456789" to als When I call the create client endpoint for "payer" @@ -37,7 +37,7 @@ Feature: Test ability to make payment to individual with bank account Then I approve the deposit for Budget Account with command "approve" for "payer" When I activate the budget account with command "activate" for "payer" Then I call the deposit account endpoint with command "deposit" for amount 9000 for "payer" - Then I add "payer" with account id "123456789" to als + Then I add "payer" with account id "323456789" to als Given I have Fineract-Platform-TenantId for "payee" When I call the create client endpoint for "payee" @@ -48,29 +48,29 @@ Feature: Test ability to make payment to individual with bank account Then I approve the deposit for Budget Account with command "approve" for "payee" When I activate the budget account with command "activate" for "payee" Then I call the deposit account endpoint with command "deposit" for amount 1000 for "payee" - Then I add "payee" with account id "400173110196" to als + Then I add "payee" with account id "1234" to als - Given I have Fineract-Platform-TenantId for "payee" + Given I have Fineract-Platform-TenantId for "payee2" When I call the create client endpoint for "payee" Then I call the create savings product endpoint for "payee" When I call the create savings account endpoint for "payee" - Then I check whether budget account exists with accoundId "1235" - Then I call the interop identifier endpoint for "payee" and accountId "1235" + Then I check whether budget account exists with accoundId "2235" + Then I call the interop identifier endpoint for "payee" and accountId "2235" Then I approve the deposit for Budget Account with command "approve" for "payee" When I activate the budget account with command "activate" for "payee" Then I call the deposit account endpoint with command "deposit" for amount 2000 for "payee" - Then I add "payee" with account id "400174120160" to als + Then I add "payee2" with account id "2235" to als - Given I have Fineract-Platform-TenantId for "payee" + Given I have Fineract-Platform-TenantId for "payee3" When I call the create client endpoint for "payee" Then I call the create savings product endpoint for "payee" When I call the create savings account endpoint for "payee" - Then I check whether budget account exists with accoundId "400173110195" - Then I call the interop identifier endpoint for "payee" and accountId "400173110195" + Then I check whether budget account exists with accoundId "3235" + Then I call the interop identifier endpoint for "payee" and accountId "3235" Then I approve the deposit for Budget Account with command "approve" for "payee" When I activate the budget account with command "activate" for "payee" Then I call the deposit account endpoint with command "deposit" for amount 3000 for "payee" - Then I add "payee" with account id "400173110195" to als + Then I add "payee3" with account id "3235" to als And I have the demo csv file "bulk_payment.csv" When I can inject MockServer @@ -81,22 +81,23 @@ Feature: Test ability to make payment to individual with bank account Then I call the register beneficiary API with expected status of 202 and stub "/registerBeneficiary" And I should be able to verify that the "PUT" method to "/registerBeneficiary" endpoint received a request with successfull registration + Scenario: BB-001 Input CSV file using the batch transaction API and poll batch summary API till we get completed status Given I have tenant as "paymentbb1" And I have the demo csv file "bulk_payment.csv" And I create a list of payee identifiers from csv file When I can inject MockServer Then I can start mock server + And I have the registeringInstituteId "SocialWelfare" + And I have the programId "Education" And I can register the stub with "/registerBeneficiary" endpoint for "PUT" request with status of 200 - And I create a IdentityMapperDTO for registering beneficiary + And I create a IdentityMapperDTO for registering payee with IAM Then I call the register beneficiary API with expected status of 202 and stub "/registerBeneficiary" And I should be able to verify that the "PUT" method to "/registerBeneficiary" endpoint received a request with successfull registration And I create a new clientCorrelationId And I have private key And I generate signature - And I have the registeringInstituteId "SocialWelfare" - And I have the programId "Education" When I call the batch transactions endpoint with expected status of 202 Then I should get non empty response @@ -116,15 +117,15 @@ Feature: Test ability to make payment to individual with bank account And I create a list of payee identifiers from csv file When I can inject MockServer Then I can start mock server + And I have the registeringInstituteId "SocialWelfare" + And I have the programId "UnconditionalCashTransfer" And I can register the stub with "/registerBeneficiary" endpoint for "PUT" request with status of 200 - And I create a IdentityMapperDTO for registering beneficiary + And I create a IdentityMapperDTO for registering payee with IAM Then I call the register beneficiary API with expected status of 202 and stub "/registerBeneficiary" And I should be able to verify that the "PUT" method to "/registerBeneficiary" endpoint received a request with successfull registration And I create a new clientCorrelationId And I have private key And I generate signature - And I have the registeringInstituteId "SocialWelfare" - And I have programId "UnconditionalCashTransfer" When I call the batch transactions endpoint with expected status of 202 Then I should get non empty response And I am able to parse batch transactions response @@ -143,15 +144,15 @@ Feature: Test ability to make payment to individual with bank account And I create a list of payee identifiers from csv file When I can inject MockServer Then I can start mock server + And I have the registeringInstituteId "Health" + And I have the programId "Maternity" And I can register the stub with "/registerBeneficiary" endpoint for "PUT" request with status of 200 - And I create a IdentityMapperDTO for registering beneficiary + And I create a IdentityMapperDTO for registering payee with IAM Then I call the register beneficiary API with expected status of 202 and stub "/registerBeneficiary" And I should be able to verify that the "PUT" method to "/registerBeneficiary" endpoint received a request with successfull registration And I create a new clientCorrelationId And I have private key And I generate signature - And I have the registeringInstituteId "Health" - And I have programId "Maternity" When I call the batch transactions endpoint with expected status of 202 Then I should get non empty response And I am able to parse batch transactions response From f6ce15e069864dfb5ee87044672318336df2080a Mon Sep 17 00:00:00 2001 From: Abhinav Mishra Date: Wed, 10 Jul 2024 16:11:55 +0530 Subject: [PATCH 09/15] budget account creation --- .../stepdef/IdentityMapperStepDef.java | 9 ++++---- .../cucumber/stepdef/MojaloopStepDef.java | 6 ++--- .../stepdef/PayerFundTransferStepDef.java | 23 ++++++++----------- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/IdentityMapperStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/IdentityMapperStepDef.java index 24d290724..954c01c91 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/IdentityMapperStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/IdentityMapperStepDef.java @@ -76,9 +76,9 @@ public class IdentityMapperStepDef extends BaseStepDef { public void iCallTheRegisterBeneficiaryAPIWithExpectedStatusOf(int expectedStatus, String stub) { RequestSpecification requestSpec = Utils.getDefaultSpec(); scenarioScopeState.response = RestAssured.given(requestSpec).header("Content-Type", "application/json") - .header("X-Registering-Institution-ID", scenarioScopeState.registeringInstituteId).header("X-CallbackURL", identityMapperConfig.callbackURL + stub) - .baseUri(identityMapperConfig.identityMapperContactPoint).body(registerBeneficiaryBody).expect() - .spec(new ResponseSpecBuilder().expectStatusCode(expectedStatus).build()).when() + .header("X-Registering-Institution-ID", scenarioScopeState.registeringInstituteId) + .header("X-CallbackURL", identityMapperConfig.callbackURL + stub).baseUri(identityMapperConfig.identityMapperContactPoint) + .body(registerBeneficiaryBody).expect().spec(new ResponseSpecBuilder().expectStatusCode(expectedStatus).build()).when() .post(identityMapperConfig.registerBeneficiaryEndpoint).andReturn().asString(); logger.info("Identity Mapper Response: {}", scenarioScopeState.response); @@ -536,7 +536,8 @@ public void iCreateAIdentityMapperDTOForRegisteringPayee() { int fspIndex = 0; Set payeeIdentifiers = new HashSet<>(scenarioScopeState.payeeIdentifiers); for (String payeeIdentifier : payeeIdentifiers) { - BeneficiaryDTO beneficiaryDTO = new BeneficiaryDTO(payeeIdentifier, "00", financialAddressArray[fspIndex], payeeFspConfig.getPayeeFsp(payeeFsp)); + BeneficiaryDTO beneficiaryDTO = new BeneficiaryDTO(payeeIdentifier, "00", financialAddressArray[fspIndex], + payeeFspConfig.getPayeeFsp(payeeFsp)); beneficiaryDTOList.add(beneficiaryDTO); fspIndex++; } diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java index ff50e6ab4..92d156597 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java @@ -122,7 +122,6 @@ public void addBudgetAccountToALS(String client, String accountId) throws JsonPr assertThat(response).isNotNull(); } - @Given("I am setting up Mojaloop") public void mojaloopSetup() throws JsonProcessingException { @@ -131,7 +130,6 @@ public void mojaloopSetup() throws JsonProcessingException { String payeeFsp2 = mojaloopConfig.payeeFspId2; String payeeFsp3 = mojaloopConfig.payeeFspId3; - if (!mojaloopDef.isHubAccountTypesAdded()) { logger.info("Calling hub account apis"); @@ -157,8 +155,8 @@ public void mojaloopSetup() throws JsonProcessingException { mojaloopDef.addInitialPositionAndLimit(payeeFsp2); mojaloopDef.addInitialPositionAndLimit(payeeFsp3); - if (!mojaloopDef.getCallbackEndpoints(payerFsp) || !mojaloopDef.getCallbackEndpoints(payeeFsp) || !mojaloopDef.getCallbackEndpoints(payeeFsp2) - || !mojaloopDef.getCallbackEndpoints(payeeFsp3)) { + if (!mojaloopDef.getCallbackEndpoints(payerFsp) || !mojaloopDef.getCallbackEndpoints(payeeFsp) + || !mojaloopDef.getCallbackEndpoints(payeeFsp2) || !mojaloopDef.getCallbackEndpoints(payeeFsp3)) { mojaloopDef.setCallbackEndpoints(); } diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java index 66d99fcff..c47d7271c 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java @@ -201,7 +201,7 @@ public void callCreateInteropBudgetIdentifierEndpoint(String client, String acco PostSavingsAccountsResponse savingsAccountResponse = objectMapper.readValue(responseSavingsAccount, PostSavingsAccountsResponse.class); - savings_account_id = savingsAccountResponse.getSavingsId().toString(); + savings_account_id = savingsAccountResponse.getSavingsId().toString(); if (client.equals("payer")) { payer_identifier = accountId; @@ -224,8 +224,6 @@ public void callCreateInteropBudgetIdentifierEndpoint(String client, String acco assertThat(fundTransferDef.responseInteropIdentifier).isNotEmpty(); } - - @Then("I approve the deposit with command {string} for {string}") public void callApproveSavingsEndpoint(String command, String client) throws JsonProcessingException { // Setting headers and body @@ -274,7 +272,6 @@ public void callApproveBudgetAccountEndpoint(String command, String client) thro assertThat(fundTransferDef.responseSavingsApprove).isNotEmpty(); } - @When("I activate the account with command {string} for {string}") public void callSavingsActivateEndpoint(String command, String client) throws JsonProcessingException { // Setting headers and body @@ -321,7 +318,6 @@ public void callBudgetAccountActivateEndpoint(String command, String client) thr assertThat(fundTransferDef.responseSavingsActivate).isNotEmpty(); } - @Then("I call the deposit account endpoint with command {string} for amount {int} for {string}") public void callDepositAccountEndpoint(String command, int amount, String client) throws JsonProcessingException { // Setting headers and body @@ -717,15 +713,14 @@ public void budgetAccountExistsWithAccoundId(String accountId) throws JsonProces String endpoint = transferConfig.interopIdentifierEndpoint; endpoint = endpoint.replaceAll("\\{\\{identifierType\\}\\}", "MSISDN"); endpoint = endpoint.replaceAll("\\{\\{identifier\\}\\}", accountId); - try { - // Calling Interop Identifier endpoint - fundTransferDef.responseInteropIdentifier = RestAssured.given(requestSpec).baseUri(transferConfig.savingsBaseUrl) - .expect().spec(new ResponseSpecBuilder().build()).when() - .delete(endpoint).andReturn().asString(); - } catch (Exception e) { - logger.error("Error checking account existence: ", e); - throw new RuntimeException("Failed to check account existence", e); - } + try { + // Calling Interop Identifier endpoint + fundTransferDef.responseInteropIdentifier = RestAssured.given(requestSpec).baseUri(transferConfig.savingsBaseUrl).expect() + .spec(new ResponseSpecBuilder().build()).when().delete(endpoint).andReturn().asString(); + } catch (Exception e) { + logger.error("Error checking account existence: ", e); + throw new RuntimeException("Failed to check account existence", e); + } logger.info("Interop Identifier Response: " + fundTransferDef.responseInteropIdentifier); assertThat(fundTransferDef.responseInteropIdentifier).isNotEmpty(); } From 217aca0100bb5e72b7e848d5804273f843c3b61e Mon Sep 17 00:00:00 2001 From: Abhinav Mishra Date: Wed, 10 Jul 2024 16:47:44 +0530 Subject: [PATCH 10/15] Updated circle ci config to include e2e tcs --- .circleci/config.yml | 49 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8442e19cb..a09eea486 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -234,6 +234,45 @@ jobs: path: build/test-results/test/TEST-org.fynarfin.integrationtest.TestRunner.xml - store_artifacts: path: build/test-results + + test-chart-e2e: + docker: + - image: cimg/openjdk:17.0.0-node + steps: + - checkout + #- run: git clone https://github.com/fynarfin/ph-ee-integration-test + - run: + name: Ngrok setup + command: curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null && echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list && sudo apt update && sudo apt install ngrok + - run: + name: Test execution + no_output_timeout: 30m + command: | + ngrok config add-authtoken $AUTH_TOKEN + echo "web_addr: $LOCAL_PORT" >> /home/circleci/.config/ngrok/ngrok.yml + ngrok http 53013 > /dev/null & + echo -n "Extracting ngrok public url ." + NGROK_PUBLIC_URL="" + while [ -z "$NGROK_PUBLIC_URL" ]; do + # Run 'curl' against ngrok API and extract public (using 'sed' command) + export NGROK_PUBLIC_URL=$(curl --silent --max-time 10 --connect-timeout 5 \ + --show-error http://127.0.0.1:$LOCAL_PORT/api/tunnels | \ + sed -nE 's/.*public_url":"https:..([^"]*).*/\1/p') + sleep 1 + echo -n "." + done + + export CALLBACK_URL="https://$NGROK_PUBLIC_URL" + echo -n "Public url ." + echo $CALLBACK_URL + ./gradlew test -Dcucumber.filter.tags="@e2e" + echo -n "Test execution is completed, kill ngrok" + pkill ngrok + - store_test_results: + path: build/test-results/test/TEST-org.fynarfin.integrationtest.TestRunner.xml + - store_artifacts: + path: build/test-results + test-chart-ams: docker: - image: cimg/openjdk:17.0.0 @@ -317,7 +356,7 @@ workflows: - AWS - Helm - slack - - test-chart-ams: + - test-chart-e2e: requires: - deploying-bpmns context: @@ -325,6 +364,14 @@ workflows: - Helm - slack - Ngrok + - test-chart-ams: + requires: + - test-chart-e2e + context: + - AWS + - Helm + - slack + - Ngrok - test-chart-gov: requires: - test-chart-ams From 7c99735d8ffad5aa0ef3e948b7a8fea52d6cf01d Mon Sep 17 00:00:00 2001 From: Phoenix <150892830+abhinavm117@users.noreply.github.com> Date: Mon, 24 Jun 2024 21:11:32 +0530 Subject: [PATCH 11/15] Updated the annotation --- .../cucumber/stepdef/GSMATransferStepDef.java | 43 +++ .../stepdef/PayerFundTransferStepDef.java | 42 +++ ...ansactioClosedLoopMojaloopFundTransfer.csv | 9 + .../batchTransactionGsmaClosedLoop.csv | 2 +- ...batchTransactionGsmaClosedLoopMojaloop.csv | 14 + src/test/java/resources/bulkPayment.feature | 307 +++++++++++++++++- 6 files changed, 406 insertions(+), 11 deletions(-) create mode 100644 src/test/java/resources/batch_demo_csv/batchTransactioClosedLoopMojaloopFundTransfer.csv create mode 100644 src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoopMojaloop.csv diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferStepDef.java index dad45a985..119b86d92 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferStepDef.java @@ -720,6 +720,49 @@ public void iCallTheBalanceApiForPayeeBalanceForCombinedTestsCases(String id) th } + @Then("I call the balance api for payer {string} balance for all combine test cases") + public void iCallTheBalanceApiForAllPayerBalanceForCombinedTestCases(String id) throws JsonProcessingException { + RequestSpecification requestSpec = Utils.getDefaultSpec(scenarioScopeState.tenant); + String finalEndpoint = amsBalanceEndpoint; + if (scenarioScopeState.payerIdentifierforBatch == null || id.equals("1")) { + scenarioScopeState.payerIdentifierforBatch = new String[15]; + } + scenarioScopeState.payerIdentifierforBatch[Integer.parseInt(id)] = scenarioScopeState.payerIdentifier; + finalEndpoint = finalEndpoint.replace("{IdentifierType}", "MSISDN"); + finalEndpoint = finalEndpoint.replace("{IdentifierId}", + (scenarioScopeState.debitParty == null) ? scenarioScopeState.payerIdentifier : scenarioScopeState.debitParty); logger.info("Endpoint: " + finalEndpoint); + scenarioScopeState.response = RestAssured.given(requestSpec).baseUri(amsBaseUrl).body("").expect() + .spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when().get(finalEndpoint).andReturn().asString(); + logger.info("Balance Response: " + scenarioScopeState.response); + InteropAccountDTO interopAccountDTO = objectMapper.readValue(scenarioScopeState.response, InteropAccountDTO.class); + assertThat( + interopAccountDTO.getAvailableBalance().intValue() >= scenarioScopeState.initialBalForPayerForBatch[Integer.parseInt(id)]) + .isTrue(); + + } + + + @Then("I call the balance api for payee {string} balance for all combine test cases") + public void iCallTheBalanceApiForPayeeBalanceForAllCombinedTestsCases(String id) throws JsonProcessingException { + RequestSpecification requestSpec = Utils.getDefaultSpec(scenarioScopeState.tenant); + String finalEndpoint = amsBalanceEndpoint; + if (scenarioScopeState.payeeIdentifierforBatch == null || id.equals("1")) { + scenarioScopeState.payeeIdentifierforBatch = new String[15]; + } + scenarioScopeState.payeeIdentifierforBatch[Integer.parseInt(id)] = scenarioScopeState.payeeIdentifier; + finalEndpoint = finalEndpoint.replace("{IdentifierType}", "MSISDN"); + finalEndpoint = finalEndpoint.replace("{IdentifierId}", + scenarioScopeState.creditParty == null ? scenarioScopeState.payeeIdentifier : scenarioScopeState.creditParty); logger.info("Endpoint: " + finalEndpoint); + scenarioScopeState.response = RestAssured.given(requestSpec).baseUri(amsBaseUrl).body("").expect() + .spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when().get(finalEndpoint).andReturn().asString(); + logger.info("Balance Response: " + scenarioScopeState.response); + InteropAccountDTO interopAccountDTO = objectMapper.readValue(scenarioScopeState.response, InteropAccountDTO.class); + assertThat( + interopAccountDTO.getAvailableBalance().intValue() >= scenarioScopeState.initialBalForPayeeForBatch[Integer.parseInt(id)]) + .isTrue(); + + } + @Then("I call the balance api for payee with id {string} balance after credit") public void iCallTheBalanceApiForPayeeBalanceAfterCredit(String id) throws JsonProcessingException { RequestSpecification requestSpec = Utils.getDefaultSpec(scenarioScopeState.tenant); diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java index c47d7271c..9467919c7 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java @@ -640,6 +640,48 @@ public void addRowToCsvFileForCombinedTestCases(String paymentMode, int transfer scenarioScopeState.gsmaP2PAmtDebitForBatch[id + 1] = transferAmount; } + + @When("I create and setup a {string} with id {string} and account balance of {int} for all combine test cases") + public void consolidatedPayeeCreationStepsForAllCombinedTestsCases(String client, String id, int amount) throws JsonProcessingException { + setTenantForPayer(client); + callCreateClientEndpoint(client); + callCreateSavingsProductEndpoint(client); + callCreateSavingsAccountEndpoint(client); + callCreateInteropIdentifierEndpoint(client); + callApproveSavingsEndpoint("approve", client); + callSavingsActivateEndpoint("activate", client); + callDepositAccountEndpoint("deposit", amount, client); + if (client.equals("payer")) { + if (scenarioScopeState.initialBalForPayerForBatch == null || id.equals("1")) { + scenarioScopeState.initialBalForPayerForBatch = new int[14]; + } + scenarioScopeState.initialBalForPayerForBatch[Integer.parseInt(id)] = amount; + assertThat(scenarioScopeState.initialBalForPayerForBatch[Integer.parseInt(id)]).isNotNull(); + + } else if (client.equals("payee")) { + if (scenarioScopeState.initialBalForPayeeForBatch == null || id.equals("1")) { + scenarioScopeState.initialBalForPayeeForBatch = new int[14]; + } + scenarioScopeState.initialBalForPayeeForBatch[Integer.parseInt(id)] = amount; + assertThat(scenarioScopeState.initialBalForPayeeForBatch[Integer.parseInt(id)]).isNotNull(); + } + } + + @Then("add row to csv with current payer and payee, payment mode as {string} and transfer amount {int} and id {int} for all combine test cases") + public void addRowToCsvFileForAllCombinedTestCases(String paymentMode, int transferAmount, int id) throws IOException { + + String[] row = { String.valueOf(id), UUID.randomUUID().toString(), paymentMode, "msisdn", scenarioScopeState.payerIdentifier, + "msisdn", scenarioScopeState.payeeIdentifier, String.valueOf(transferAmount), "USD", "Test Payee Payment" }; + String filePath = Utils.getAbsoluteFilePathToResource(scenarioScopeState.filename); + csvHelper.addRow(filePath, row); + scenarioScopeState.gsmaP2PAmtDebit = scenarioScopeState.gsmaP2PAmtDebit + transferAmount; + if (scenarioScopeState.gsmaP2PAmtDebitForBatch == null || id == 1) { + scenarioScopeState.gsmaP2PAmtDebitForBatch = new int[14]; + } + scenarioScopeState.gsmaP2PAmtDebitForBatch[id + 1] = transferAmount; + } + + @Then("add last row to csv with current payer and payee, payment mode as {string} and transfer amount {int} and id {int}") public void addLastRowToCsvFile(String paymentMode, int transferAmount, int id) throws IOException { diff --git a/src/test/java/resources/batch_demo_csv/batchTransactioClosedLoopMojaloopFundTransfer.csv b/src/test/java/resources/batch_demo_csv/batchTransactioClosedLoopMojaloopFundTransfer.csv new file mode 100644 index 000000000..186f4b564 --- /dev/null +++ b/src/test/java/resources/batch_demo_csv/batchTransactioClosedLoopMojaloopFundTransfer.csv @@ -0,0 +1,9 @@ +id,request_id,payment_mode,payer_identifier_type,payer_identifier,payee_identifier_type,payee_identifier,amount,currency,note +0,dbe1d284-1bea-4f03-bc0f-8faece9f5da2,closedloop,msisdn,2300,msisdn,1759,10,USD,Test Payee Payment +1,696a9340-adc2-48e3-a1d1-10a239bc412b,closedloop,msisdn,2301,msisdn,1760,5,USD,Test Payee Payment +2,8e2eaf78-4566-438e-9183-ec02288fd16b,closedloop,msisdn,2302,msisdn,1761,5,USD,Test Payee Payment +3,b9bc0bc8-cf25-417a-adbc-97345330737a,closedloop,msisdn,2303,msisdn,1762,5,USD,Test Payee Payment +4,a59acbe1-4ebb-4618-bda3-630f2c306e09,closedloop,msisdn,2304,msisdn,1763,5,USD,Test Payee Payment +5,d79a4bc6-f9ec-4eba-beb7-96277bd832b3,mojaloop,msisdn,2305,msisdn,1764,3,USD,Test Payee Payment +6,1f838585-5091-44ef-9432-77d13b9c4583,mojaloop,msisdn,2306,msisdn,1764,2,USD,Test Payee Payment +7,94fd7bd1-7482-4f4f-bf12-a21ab4b550a8,mojaloop,msisdn,2307,msisdn,1765,1,USD,Test Payee Payment \ No newline at end of file diff --git a/src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoop.csv b/src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoop.csv index f03d5970e..56cf0f79d 100644 --- a/src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoop.csv +++ b/src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoop.csv @@ -6,4 +6,4 @@ id,request_id,payment_mode,payer_identifier_type,payer_identifier,payee_identifi 4,777035ca-a4d9-4725-b905-0c840b567c51,closedloop,msisdn,5401,msisdn,5145,5,USD,Test Payee Payment 5,f50f0d85-7fec-44ad-8a3f-0811b4926db6,gsma,msisdn,5402,msisdn,5146,6,USD,Test Payee Payment 6,9c780986-28a9-45eb-896e-1139ef2a15c2,gsma,msisdn,5403,msisdn,5147,7,USD,Test Payee Payment -7,09abfde9-73c8-45d9-a89c-9623eacddcd3,gsma,msisdn,5404,msisdn,5148,8,USD,Test Payee Payment \ No newline at end of file +7,09abfde9-73c8-45d9-a89c-9623eacddcd3,gsma,msisdn,5404,msisdn,5148,8,USD,Test Payee Payment diff --git a/src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoopMojaloop.csv b/src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoopMojaloop.csv new file mode 100644 index 000000000..cc812093b --- /dev/null +++ b/src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoopMojaloop.csv @@ -0,0 +1,14 @@ +id,request_id,payment_mode,payer_identifier_type,payer_identifier,payee_identifier_type,payee_identifier,amount,currency,note +0,c36e35ea-bdfc-4e6f-b312-3c598f527447,closedloop,msisdn,2311,msisdn,1767,10,USD,Test Payee Payment +1,b03f5f6a-6c51-4c6f-9b8a-6ea5db515bf4,closedloop,msisdn,2312,msisdn,1768,5,USD,Test Payee Payment +2,a7f4bf74-297e-4b31-821e-db453f0199da,closedloop,msisdn,2313,msisdn,1769,5,USD,Test Payee Payment +3,4322ed84-e4c5-4536-926e-659d9aac2e18,closedloop,msisdn,2314,msisdn,1770,5,USD,Test Payee Payment +4,0af8d8c8-3c79-4f2c-9a61-00afd545e2a8,closedloop,msisdn,2315,msisdn,1771,5,USD,Test Payee Payment +5,4c746765-3fab-46b0-85fb-28d8882636f0,gsma,msisdn,2316,msisdn,1772,6,USD,Test Payee Payment +6,86e3f820-c795-45f0-91ef-1362a4d37df5,gsma,msisdn,2318,msisdn,1774,7,USD,Test Payee Payment +7,8e539370-8397-4a34-a16d-00a755515686,gsma,msisdn,2319,msisdn,1775,8,USD,Test Payee Payment +8,b5853d34-e828-4644-ae34-abe10e4a1547,gsma,msisdn,2321,msisdn,1776,9,USD,Test Payee Payment +9,504fbd96-60d6-4e7c-837b-e687e210fa75,gsma,msisdn,2322,msisdn,1777,10,USD,Test Payee Payment +10,e89e2900-c1bb-458b-ba1f-0a8d182e33f7,mojaloop,msisdn,2324,msisdn,1778,3,USD,Test Payee Payment +11,08d93b60-92e9-4667-a279-77c452566f22,mojaloop,msisdn,2325,msisdn,1778,2,USD,Test Payee Payment +12,bb6375d2-aa2f-4b68-b53d-cf73f4b6a47e,mojaloop,msisdn,2326,msisdn,1779,1,USD,Test Payee Payment \ No newline at end of file diff --git a/src/test/java/resources/bulkPayment.feature b/src/test/java/resources/bulkPayment.feature index 91bb38be9..7c24b2e75 100644 --- a/src/test/java/resources/bulkPayment.feature +++ b/src/test/java/resources/bulkPayment.feature @@ -1,7 +1,8 @@ -@gov @ext +@e2e Feature: Test ability to make payment to individual with bank account - Scenario: BB-000 Create Budget Account and Register Payee + @commonExtended + Scenario: BB-FSP 001 Create Budget Account and Register Payee Given I am setting up Mojaloop And I have the registeringInstituteId "SocialWelfare" And I have the programId "Education" @@ -82,7 +83,7 @@ Feature: Test ability to make payment to individual with bank account And I should be able to verify that the "PUT" method to "/registerBeneficiary" endpoint received a request with successfull registration - Scenario: BB-001 Input CSV file using the batch transaction API and poll batch summary API till we get completed status + Scenario: BB-FSP 002 Input CSV file using the batch transaction API and poll batch summary API till we get completed status Given I have tenant as "paymentbb1" And I have the demo csv file "bulk_payment.csv" And I create a list of payee identifiers from csv file @@ -111,7 +112,7 @@ Feature: Test ability to make payment to individual with bank account And I should have matching total txn count and successful txn count in response - Scenario: BB-002 Input CSV file using the batch transaction API and poll batch summary API till we get completed status + Scenario: BB-FSP 003 Input CSV file using the batch transaction API and poll batch summary API till we get completed status Given I have tenant as "paymentbb1" And I have the demo csv file "bulk_payment.csv" And I create a list of payee identifiers from csv file @@ -138,7 +139,7 @@ Feature: Test ability to make payment to individual with bank account And I should have matching total txn count and successful txn count in response - Scenario: BB-003 Input CSV file using the batch transaction API and poll batch summary API till we get completed status + Scenario: BB-FSP 004 Input CSV file using the batch transaction API and poll batch summary API till we get completed status Given I have tenant as "paymentbb1" And I have the demo csv file "bulk_payment.csv" And I create a list of payee identifiers from csv file @@ -164,12 +165,14 @@ Feature: Test ability to make payment to individual with bank account And Status of transaction is "COMPLETED" And I should have matching total txn count and successful txn count in response - Scenario: Bulk Transfer with ClosedLoop and Mojaloop - Given I have tenant as "paymentbb2" - And I have the demo csv file "bulk_payment_closedl_mock_mojaloop.csv" + Scenario:BB-FSP 005 Input CSV file using the batch transaction API and poll batch summary API till we get completed status + Given I have tenant as "paymentbb1" + And I have the demo csv file "bulk_payment.csv" And I create a list of payee identifiers from csv file When I can inject MockServer Then I can start mock server + And I have the registeringInstituteId "SocialWelfare" + And I have the programId "Education" And I can register the stub with "/registerBeneficiary" endpoint for "PUT" request with status of 200 And I create a IdentityMapperDTO for registering beneficiary Then I call the register beneficiary API with expected status of 202 and stub "/registerBeneficiary" @@ -182,13 +185,39 @@ Feature: Test ability to make payment to individual with bank account And I am able to parse batch transactions response And I fetch batch ID from batch transaction API's response # Then I will sleep for 10000 millisecond - Given I have tenant as "paymentbb2" + Given I have tenant as "paymentbb1" + When I call the batch summary API with expected status of 200 with total 6 txns + Then I am able to parse batch summary response + And Status of transaction is "COMPLETED" + And I should have matching total txn count and successful txn count in response + + Scenario:BB-FSP 006 Bulk Transfer with ClosedLoop and Mojaloop + Given I have tenant as "payerfsp" + And I have the demo csv file "bulk_payment_closedl_mock_mojaloop.csv" + And I create a list of payee identifiers from csv file + When I can inject MockServer + Then I can start mock server + And I have the registeringInstituteId "SocialWelfare" + And I have the programId "Education" + And I can register the stub with "/registerBeneficiary" endpoint for "PUT" request with status of 200 + And I create a IdentityMapperDTO for registering beneficiary + Then I call the register beneficiary API with expected status of 202 and stub "/registerBeneficiary" + And I should be able to verify that the "PUT" method to "/registerBeneficiary" endpoint received a request with successfull registration + And I create a new clientCorrelationId + And I have private key + And I generate signature + When I call the batch transactions endpoint with expected status of 202 + Then I should get non empty response + And I am able to parse batch transactions response + And I fetch batch ID from batch transaction API's response + Then I will sleep for 10000 millisecond + Given I have tenant as "payerfsp" When I call the batch summary API with expected status of 200 with total successfull 8 txns Then I am able to parse batch summary response And Status of transaction is "COMPLETED" And My total txns 8 and successful txn count in response should Match - Scenario: Bulk Transfer with ClosedLoop and GSMA + Scenario:BB-FSP 007 Bulk Transfer with ClosedLoop and GSMA #payer 1 creation Given I have Fineract-Platform-TenantId as "payerfsp2" And I initialize the payee list @@ -287,6 +316,9 @@ Feature: Test ability to make payment to individual with bank account When I can inject MockServer Then I can start mock server + And I have the registeringInstituteId "SocialWelfare" + And I have the programId "Education" + And I can register the stub with "/registerBeneficiary" endpoint for "PUT" request with status of 200 And I create a IdentityMapperDTO for registering beneficiary Then I call the register beneficiary API with expected status of 202 and stub "/registerBeneficiary" @@ -307,3 +339,258 @@ Feature: Test ability to make payment to individual with bank account And Status of transaction is "COMPLETED" And My total txns 8 and successful txn count in response should Match + + Scenario:BB-FSP 008 Bulk Transfer with Closedloop and Real Mojaloop + #payer 1 creation + Given I have Fineract-Platform-TenantId as "payerfsp2" + And I initialize the payee list + When I create and setup a "payer" with id "1" and account balance of 100 for combine test cases + Given I have tenant as "payerfsp" + Then I call the balance api for payer "1" balance for combine test cases + #payee 1 creation + When I create and setup a "payee" with id "1" and account balance of 10 for combine test cases + Given I have tenant as "payeefsp3" + Then I call the balance api for payee "1" balance for combine test cases + + Then Create a csv file with file name "batchTransactioClosedLoopMojaloopFundTransfer.csv" + Then add row to csv with current payer and payee, payment mode as "closedloop" and transfer amount 10 and id 0 for combine test cases + + #payer 2 creation + Given I have Fineract-Platform-TenantId as "payerfsp2" + When I create and setup a "payer" with id "2" and account balance of 50 for combine test cases + Given I have tenant as "payerfsp" + Then I call the balance api for payer "2" balance for combine test cases + #payee 2 creation + When I create and setup a "payee" with id "2" and account balance of 20 for combine test cases + Given I have tenant as "payeefsp3" + Then I call the balance api for payee "2" balance for combine test cases + + Then add row to csv with current payer and payee, payment mode as "closedloop" and transfer amount 5 and id 1 for combine test cases + + #payer 3 creation + Given I have Fineract-Platform-TenantId as "payerfsp2" + When I create and setup a "payer" with id "3" and account balance of 50 for combine test cases + Given I have tenant as "payerfsp" + Then I call the balance api for payer "3" balance + #payee 3 creation + When I create and setup a "payee" with id "3" and account balance of 20 for combine test cases + Given I have tenant as "payeefsp3" + Then I call the balance api for payee "3" balance for combine test cases + + Then add row to csv with current payer and payee, payment mode as "closedloop" and transfer amount 5 and id 2 for combine test cases + + #payer 4 creation + Given I have Fineract-Platform-TenantId as "payerfsp2" + When I create and setup a "payer" with id "4" and account balance of 50 for combine test cases + Given I have tenant as "payerfsp" + Then I call the balance api for payer "4" balance for combine test cases + #payee 4 creation + When I create and setup a "payee" with id "4" and account balance of 20 for combine test cases + Given I have tenant as "payeefsp3" + Then I call the balance api for payee "4" balance for combine test cases + + Then add row to csv with current payer and payee, payment mode as "closedloop" and transfer amount 5 and id 3 for combine test cases + #payer 5 creation + Given I have Fineract-Platform-TenantId as "payerfsp2" + When I create and setup a "payer" with id "5" and account balance of 50 for combine test cases + Given I have tenant as "payerfsp" + Then I call the balance api for payer "5" balance for combine test cases + #payee 5 creation + When I create and setup a "payee" with id "5" and account balance of 20 for combine test cases + Given I have tenant as "payeefsp3" + Then I call the balance api for payee "5" balance for combine test cases + + Then add row to csv with current payer and payee, payment mode as "closedloop" and transfer amount 5 and id 4 for combine test cases + #Mojaloop + Given I am setting up Mojaloop + #payer and payee 6 for mojaloop [1] + When I create and setup a "payer" with account balance of 12 + When I create and setup a "payee" with account balance of 10 + Then I add "payer" to als + Then I add "payee" to als + Then add row to csv with current payer and payee, payment mode as "mojaloop" and transfer amount 3 and id 5 for combine test cases + + #payer and payee 7 for mojaloop [2] + Then I add "payer" to als + When I create and setup a "payer" with account balance of 120 + Then add row to csv with current payer and payee, payment mode as "mojaloop" and transfer amount 2 and id 6 for combine test cases + + When I create and setup a "payer" with account balance of 66 + When I create and setup a "payee" with account balance of 10 + Then I add "payer" to als + Then I add "payee" to als + Then add last row to csv with current payer and payee, payment mode as "mojaloop" and transfer amount 1 and id 7 + + Given I have Fineract-Platform-TenantId for "payer" + And I create a new clientCorrelationId + And I have private key + And I generate signature + + When I call the batch transactions endpoint with expected status of 202 + Then I should get non empty response + And I am able to parse batch transactions response + And I fetch batch ID from batch transaction API's response + Then I will sleep for 10000 millisecond + Given I have tenant as "payerfsp" + When I call the batch summary API with expected status of 200 with total successfull 8 txns + Then I am able to parse batch summary response + And Status of transaction is "COMPLETED" + And My total txns 8 and successful txn count in response should Match + + + Scenario:BB-FSP 009 Bulk Transfer with ClosedLoop, Real mojaloop and Real GSMA + #payer 1 creation + Given I have Fineract-Platform-TenantId as "payerfsp2" + And I initialize the payee list + When I create and setup a "payer" with id "1" and account balance of 100 for all combine test cases + Given I have tenant as "payerfsp" + Then I call the balance api for payer "1" balance for all combine test cases + #payee 1 creation + When I create and setup a "payee" with id "1" and account balance of 10 for all combine test cases + Given I have tenant as "payeefsp3" + Then I call the balance api for payee "1" balance for all combine test cases + + Then Create a csv file with file name "batchTransactionGsmaClosedLoopMojaloop.csv" + Then add row to csv with current payer and payee, payment mode as "closedloop" and transfer amount 10 and id 0 for all combine test cases + + #payer 2 creation + Given I have Fineract-Platform-TenantId as "payerfsp2" + When I create and setup a "payer" with id "2" and account balance of 50 for all combine test cases + Given I have tenant as "payerfsp" + Then I call the balance api for payer "2" balance for all combine test cases + #payee 2 creation + When I create and setup a "payee" with id "2" and account balance of 20 for all combine test cases + Given I have tenant as "payeefsp3" + Then I call the balance api for payee "2" balance for all combine test cases + + Then add row to csv with current payer and payee, payment mode as "closedloop" and transfer amount 5 and id 1 for all combine test cases + + #payer 3 creation + Given I have Fineract-Platform-TenantId as "payerfsp2" + When I create and setup a "payer" with id "3" and account balance of 50 for all combine test cases + Given I have tenant as "payerfsp" + Then I call the balance api for payer "3" balance for all combine test cases + #payee 3 creation + When I create and setup a "payee" with id "3" and account balance of 20 for all combine test cases + Given I have tenant as "payeefsp3" + Then I call the balance api for payee "3" balance for all combine test cases + + Then add row to csv with current payer and payee, payment mode as "closedloop" and transfer amount 5 and id 2 for all combine test cases + + #payer 4 creation + Given I have Fineract-Platform-TenantId as "payerfsp2" + When I create and setup a "payer" with id "4" and account balance of 50 + Given I have tenant as "payerfsp" + Then I call the balance api for payer "4" balance for all combine test cases + #payee 4 creation + When I create and setup a "payee" with id "4" and account balance of 20 for all combine test cases + Given I have tenant as "payeefsp3" + Then I call the balance api for payee "4" balance for all combine test cases + + Then add row to csv with current payer and payee, payment mode as "closedloop" and transfer amount 5 and id 3 for all combine test cases + #payer 5 creation + Given I have Fineract-Platform-TenantId as "payerfsp2" + When I create and setup a "payer" with id "5" and account balance of 50 for all combine test cases + Given I have tenant as "payerfsp" + Then I call the balance api for payer "5" balance for all combine test cases + #payee 5 creation + When I create and setup a "payee" with id "5" and account balance of 20 for all combine test cases + Given I have tenant as "payeefsp3" + Then I call the balance api for payee "5" balance for all combine test cases + + Then add row to csv with current payer and payee, payment mode as "closedloop" and transfer amount 5 and id 4 for all combine test cases + + #payer 6 creation + Given I have Fineract-Platform-TenantId as "payerfsp2" + When I create and setup a "payer" with id "6" and account balance of 50 for all combine test cases + Given I have tenant as "payerfsp" + Then I call the balance api for payer "6" balance for all combine test cases + #payee 6 creation + When I create and setup a "payee" with id "6" and account balance of 20 for all combine test cases + Given I have tenant as "payeefsp3" + Then I call the balance api for payee "6" balance for all combine test cases + + Then add row to csv with current payer and payee, payment mode as "gsma" and transfer amount 6 and id 5 for all combine test cases + + #payer 7 creation + Given I have Fineract-Platform-TenantId as "payerfsp2" + When I create and setup a "payer" with id "7" and account balance of 50 for all combine test cases + Given I have tenant as "payerfsp" + Then I call the balance api for payer "7" balance for all combine test cases + #payee 7 creation + When I create and setup a "payee" with id "7" and account balance of 20 for all combine test cases + Given I have tenant as "payeefsp3" + Then I call the balance api for payee "7" balance for all combine test cases + + Then add row to csv with current payer and payee, payment mode as "gsma" and transfer amount 7 and id 6 for all combine test cases + #payer 8 creation + Given I have Fineract-Platform-TenantId as "payerfsp2" + When I create and setup a "payer" with id "8" and account balance of 30 for all combine test cases + Given I have tenant as "payerfsp" + Then I call the balance api for payer "8" balance for all combine test cases + #payee 8 creation + When I create and setup a "payee" with id "8" and account balance of 30 for all combine test cases + Given I have tenant as "payeefsp3" + Then I call the balance api for payee "8" balance for all combine test cases + + Then add row to csv with current payer and payee, payment mode as "gsma" and transfer amount 8 and id 7 for all combine test cases + + #payer 9 creation + Given I have Fineract-Platform-TenantId as "payerfsp2" + When I create and setup a "payer" with id "9" and account balance of 50 for all combine test cases + Given I have tenant as "payerfsp" + Then I call the balance api for payer "9" balance for all combine test cases + #payee 9 creation + When I create and setup a "payee" with id "9" and account balance of 20 for all combine test cases + Given I have tenant as "payeefsp3" + Then I call the balance api for payee "9" balance for all combine test cases + + Then add row to csv with current payer and payee, payment mode as "gsma" and transfer amount 9 and id 8 for all combine test cases + #payer 10 creation + Given I have Fineract-Platform-TenantId as "payerfsp2" + When I create and setup a "payer" with id "10" and account balance of 30 for all combine test cases + Given I have tenant as "payerfsp" + Then I call the balance api for payer "10" balance for all combine test cases + #payee 10 creation + When I create and setup a "payee" with id "10" and account balance of 30 for all combine test cases + Given I have tenant as "payeefsp3" + Then I call the balance api for payee "10" balance for all combine test cases + + Then add row to csv with current payer and payee, payment mode as "gsma" and transfer amount 10 and id 9 for all combine test cases + + #Mojaloop batch setup + Given I am setting up Mojaloop + #payer and payee 10 for mojaloop [1] + When I create and setup a "payer" with account balance of 12 + When I create and setup a "payee" with account balance of 10 + Then I add "payer" to als + Then I add "payee" to als + Then add row to csv with current payer and payee, payment mode as "mojaloop" and transfer amount 3 and id 10 for all combine test cases + + #payer and payee 11 for mojaloop [2] + Then I add "payer" to als + When I create and setup a "payer" with account balance of 120 + Then add row to csv with current payer and payee, payment mode as "mojaloop" and transfer amount 2 and id 11 for all combine test cases + + #payer and payee 12 for mojaloop [3] + When I create and setup a "payer" with account balance of 66 + When I create and setup a "payee" with account balance of 10 + Then I add "payer" to als + Then I add "payee" to als + Then add last row to csv with current payer and payee, payment mode as "mojaloop" and transfer amount 1 and id 12 + + #batch process + Given I have tenant as "payerfsp" + And I have the demo csv file "batchTransactionGsmaClosedLoopMojaloop.csv" + And I generate clientCorrelationId + And I have private key + And I generate signature + When I call the batch transactions endpoint with expected status of 202 + And I am able to parse batch transactions response + And I fetch batch ID from batch transaction API's response + Then I will sleep for 10000 millisecond + When I call the batch summary API with expected status of 200 with total successfull 13 txns + Then I should get non empty response + Then I am able to parse batch summary response + And Status of transaction is "COMPLETED" + And My total txns 13 and successful txn count in response should Match From 47c9c6f02f5a3345cac5b774595fea6787b2db78 Mon Sep 17 00:00:00 2001 From: Abhinav Mishra Date: Wed, 10 Jul 2024 23:22:03 +0530 Subject: [PATCH 12/15] Made Utility Constructor private Ma --- .github/workflows/jit-security.yml | 53 +++++++++--------- .jit/jit-integration.yml | 1 + src/main/resources/application.yaml | 2 - .../cucumber/stepdef/GSMATransferStepDef.java | 56 +++++++++++++------ .../cucumber/stepdef/MojaloopStepDef.java | 21 ++++--- .../stepdef/PayerFundTransferDef.java | 6 +- .../stepdef/PayerFundTransferStepDef.java | 23 ++++---- .../org/mifos/integrationtest/util/Util.java | 12 ++++ .../batchTransactionGsmaClosedLoop.csv | 9 --- ...batchTransactionGsmaClosedLoopMojaloop.csv | 14 ----- .../batch_demo_csv/bulk_payment2.csv | 7 --- src/test/java/resources/bulkPayment.feature | 4 +- 12 files changed, 107 insertions(+), 101 deletions(-) create mode 100644 src/test/java/org/mifos/integrationtest/util/Util.java delete mode 100644 src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoop.csv delete mode 100644 src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoopMojaloop.csv delete mode 100644 src/test/java/resources/batch_demo_csv/bulk_payment2.csv diff --git a/.github/workflows/jit-security.yml b/.github/workflows/jit-security.yml index d3babba2a..35081f292 100644 --- a/.github/workflows/jit-security.yml +++ b/.github/workflows/jit-security.yml @@ -21,7 +21,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-trivy-alpine:latest - + enrich: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'enrich' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-enrichment-code' runs-on: ubuntu-22.04 @@ -31,7 +31,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-enrichment-slim:latest - + iac-misconfig-detection-kubernetes: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'iac-misconfig-detection-kubernetes' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-kubernetes-iac-misconfiguration-detection' runs-on: ubuntu-22.04 @@ -41,7 +41,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-kubescape-slim:latest - + remediation-pr: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'remediation-pr' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-remediation-pr' runs-on: ubuntu-22.04 @@ -51,7 +51,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/open-remediation-pr-alpine:latest - + secret-detection: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'secret-detection' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-secret-detection' runs-on: ubuntu-22.04 @@ -61,7 +61,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-gitleaks-alpine:latest - + software-bill-of-materials: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-bill-of-materials' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sbom' runs-on: ubuntu-22.04 @@ -72,7 +72,7 @@ jobs: with: security_control: registry.jit.io/control-syft-alpine:latest fail_if_cannot_checkout: false - + software-component-analysis-elixir: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-elixir' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -82,7 +82,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-osv-scanner-alpine:latest - + software-component-analysis-go: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-go' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -92,7 +92,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-nancy-alpine:latest - + software-component-analysis-gradle: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-gradle' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -102,7 +102,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-jit-gradle-scanner:latest - + software-component-analysis-java: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-java' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -112,7 +112,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-osv-scanner-alpine:latest - + software-component-analysis-js: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-js' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -122,7 +122,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-npm-audit-slim:latest - + software-component-analysis-php: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-php' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -132,7 +132,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-osv-scanner-alpine:latest - + software-component-analysis-poetry: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-poetry' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -142,7 +142,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-osv-scanner-alpine:latest - + software-component-analysis-python: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-python' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -152,7 +152,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-osv-scanner-alpine:latest - + software-component-analysis-trivy-csharp: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-trivy-csharp' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -162,7 +162,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-trivy-dotnet-slim:latest - + static-code-analysis-c-cpp: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-c-cpp' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -172,7 +172,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-csharp: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-csharp' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -182,7 +182,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-go: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-go' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -192,7 +192,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-gosec-alpine:latest - + static-code-analysis-java: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-java' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -202,7 +202,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-js: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-js' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -212,7 +212,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-kotlin: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-kotlin' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -222,7 +222,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-php: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-php' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -232,7 +232,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-python-semgrep: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-python-semgrep' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -242,7 +242,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-ruby: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-ruby' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -252,7 +252,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-rust: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-rust' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -262,7 +262,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-scala: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-scala' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -272,7 +272,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-swift: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-swift' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -282,4 +282,3 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - \ No newline at end of file diff --git a/.jit/jit-integration.yml b/.jit/jit-integration.yml index e69de29bb..8b1378917 100644 --- a/.jit/jit-integration.yml +++ b/.jit/jit-integration.yml @@ -0,0 +1 @@ + diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 150db6fb5..07386015a 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -186,7 +186,6 @@ config: payerFundTransfer: tenant: payer: "wakanda" - payee: "jupiter" payee1: "jupiter" payee2: "pluto" payee3: "venus" @@ -194,7 +193,6 @@ payerFundTransfer: mojaloop: fspid: payer: "payerfsp" - payee: "payeefsp" payee1: "payeefsp" payee2: "payeefsp2" payee3: "payeefsp3" diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferStepDef.java index 119b86d92..1fdc0a06c 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferStepDef.java @@ -35,6 +35,7 @@ import org.mifos.connector.common.identityaccountmapper.dto.BeneficiaryDTO; import org.mifos.integrationtest.common.Utils; import org.mifos.integrationtest.config.GsmaConfig; +import org.mifos.integrationtest.util.Util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -724,13 +725,14 @@ public void iCallTheBalanceApiForPayeeBalanceForCombinedTestsCases(String id) th public void iCallTheBalanceApiForAllPayerBalanceForCombinedTestCases(String id) throws JsonProcessingException { RequestSpecification requestSpec = Utils.getDefaultSpec(scenarioScopeState.tenant); String finalEndpoint = amsBalanceEndpoint; - if (scenarioScopeState.payerIdentifierforBatch == null || id.equals("1")) { - scenarioScopeState.payerIdentifierforBatch = new String[15]; - } + // Check whether a new batch been initialized + initializeIfNotInitialized(id); scenarioScopeState.payerIdentifierforBatch[Integer.parseInt(id)] = scenarioScopeState.payerIdentifier; - finalEndpoint = finalEndpoint.replace("{IdentifierType}", "MSISDN"); - finalEndpoint = finalEndpoint.replace("{IdentifierId}", - (scenarioScopeState.debitParty == null) ? scenarioScopeState.payerIdentifier : scenarioScopeState.debitParty); logger.info("Endpoint: " + finalEndpoint); + String accountId = (scenarioScopeState.debitParty == null) ? scenarioScopeState.payerIdentifier : scenarioScopeState.debitParty; + String identifierType = "MSISDN"; + finalEndpoint = Util.getFormattedEndpoint(finalEndpoint, "{IdentifierType}", identifierType); + finalEndpoint = Util.getFormattedEndpoint(finalEndpoint, "{IdentifierId}", accountId); + logger.info("Endpoint: {} ", finalEndpoint); scenarioScopeState.response = RestAssured.given(requestSpec).baseUri(amsBaseUrl).body("").expect() .spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when().get(finalEndpoint).andReturn().asString(); logger.info("Balance Response: " + scenarioScopeState.response); @@ -738,21 +740,41 @@ public void iCallTheBalanceApiForAllPayerBalanceForCombinedTestCases(String id) assertThat( interopAccountDTO.getAvailableBalance().intValue() >= scenarioScopeState.initialBalForPayerForBatch[Integer.parseInt(id)]) .isTrue(); + } + + public void initializeIfNotInitialized(String id) { + if (shouldInitializeArray(id)) { + scenarioScopeState.payerIdentifierforBatch = new String[15]; + } + } + + private boolean shouldInitializeArray(String id) { + return scenarioScopeState.payerIdentifierforBatch == null || id.equals("1"); + } + public void initializeIfNotInitializedForPayee(String id) { + if (shouldInitializeArrayForPayee(id)) { + scenarioScopeState.payeeIdentifierforBatch = new String[15]; + } } + private boolean shouldInitializeArrayForPayee(String id) { + return scenarioScopeState.payeeIdentifierforBatch == null || id.equals("1"); + } @Then("I call the balance api for payee {string} balance for all combine test cases") public void iCallTheBalanceApiForPayeeBalanceForAllCombinedTestsCases(String id) throws JsonProcessingException { RequestSpecification requestSpec = Utils.getDefaultSpec(scenarioScopeState.tenant); String finalEndpoint = amsBalanceEndpoint; - if (scenarioScopeState.payeeIdentifierforBatch == null || id.equals("1")) { - scenarioScopeState.payeeIdentifierforBatch = new String[15]; - } + + initializeIfNotInitializedForPayee(id); scenarioScopeState.payeeIdentifierforBatch[Integer.parseInt(id)] = scenarioScopeState.payeeIdentifier; - finalEndpoint = finalEndpoint.replace("{IdentifierType}", "MSISDN"); - finalEndpoint = finalEndpoint.replace("{IdentifierId}", - scenarioScopeState.creditParty == null ? scenarioScopeState.payeeIdentifier : scenarioScopeState.creditParty); logger.info("Endpoint: " + finalEndpoint); + String identifierId = (scenarioScopeState.creditParty == null) ? scenarioScopeState.payeeIdentifier + : scenarioScopeState.creditParty; + String identifierType = "MSISDN"; + finalEndpoint = Util.getFormattedEndpoint(finalEndpoint, "{IdentifierType}", identifierType); + finalEndpoint = Util.getFormattedEndpoint(finalEndpoint, "{IdentifierId}", identifierId); + logger.info("Endpoint: {}", finalEndpoint); scenarioScopeState.response = RestAssured.given(requestSpec).baseUri(amsBaseUrl).body("").expect() .spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when().get(finalEndpoint).andReturn().asString(); logger.info("Balance Response: " + scenarioScopeState.response); @@ -767,16 +789,18 @@ public void iCallTheBalanceApiForPayeeBalanceForAllCombinedTestsCases(String id) public void iCallTheBalanceApiForPayeeBalanceAfterCredit(String id) throws JsonProcessingException { RequestSpecification requestSpec = Utils.getDefaultSpec(scenarioScopeState.tenant); String finalEndpoint = amsBalanceEndpoint; - finalEndpoint = finalEndpoint.replace("{IdentifierType}", "MSISDN"); - finalEndpoint = finalEndpoint.replace("{IdentifierId}", scenarioScopeState.payeeIdentifierforBatch[Integer.parseInt(id)]); - logger.info("Endpoint: " + finalEndpoint); + String identifierId = (scenarioScopeState.creditParty == null) ? scenarioScopeState.payeeIdentifier + : scenarioScopeState.creditParty; + String identifierType = "MSISDN"; + finalEndpoint = Util.getFormattedEndpoint(finalEndpoint, "{IdentifierType}", identifierType); + finalEndpoint = Util.getFormattedEndpoint(finalEndpoint, "{IdentifierId}", identifierId); + logger.info("Endpoint: {}", finalEndpoint); scenarioScopeState.response = RestAssured.given(requestSpec).baseUri(amsBaseUrl).body("").expect() .spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when().get(finalEndpoint).andReturn().asString(); logger.info("Balance Response: " + scenarioScopeState.response); InteropAccountDTO interopAccountDTO = objectMapper.readValue(scenarioScopeState.response, InteropAccountDTO.class); assertThat(interopAccountDTO.getAvailableBalance().intValue() == scenarioScopeState.initialBalForPayeeForBatch[Integer.parseInt(id)] + scenarioScopeState.gsmaP2PAmtDebitForBatch[Integer.parseInt(id)]).isTrue(); - } @Then("I call the balance api for payer {string} balance") diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java index 92d156597..4feb8d7b2 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java @@ -11,6 +11,7 @@ import io.restassured.specification.RequestSpecification; import org.mifos.integrationtest.common.Utils; import org.mifos.integrationtest.config.MojaloopConfig; +import org.mifos.integrationtest.util.Util; import org.springframework.beans.factory.annotation.Autowired; public class MojaloopStepDef extends BaseStepDef { @@ -24,6 +25,8 @@ public class MojaloopStepDef extends BaseStepDef { @Autowired ScenarioScopeState scenarioScopeState; + private static final String CONTENT_TYPE = "application/vnd.interoperability.participants+json;version=1.0"; + @Then("I add {string} to als") public void addUsersToALS(String client) throws JsonProcessingException { @@ -51,7 +54,7 @@ public void addUsersToALS(String client) throws JsonProcessingException { RequestSpecification requestSpec = Utils.getDefaultSpec(); requestSpec.header("FSPIOP-Source", fspId); requestSpec.header("Date", getCurrentDateInFormat()); - requestSpec.header("Accept", "application/vnd.interoperability.participants+json;version=1"); + requestSpec.header("Accept", CONTENT_TYPE); // requestSpec.header("Content-Type", "application/vnd.interoperability.participants+json;version=1.0"); String endpoint = mojaloopConfig.addUserToAlsEndpoint; @@ -66,8 +69,8 @@ public void addUsersToALS(String client) throws JsonProcessingException { String response = RestAssured.given(requestSpec).baseUri(mojaloopConfig.mojaloopBaseurl) .config(RestAssured.config().encoderConfig(encoderConfig().appendDefaultContentCharsetToContentTypeIfUndefined(false))) - .body(requestBody).contentType("application/vnd.interoperability.participants+json;version=1.0").expect() - .spec(new ResponseSpecBuilder().expectStatusCode(202).build()).when().post(endpoint).andReturn().asString(); + .body(requestBody).contentType(CONTENT_TYPE).expect().spec(new ResponseSpecBuilder().expectStatusCode(202).build()).when() + .post(endpoint).andReturn().asString(); logger.info(response); assertThat(response).isNotNull(); @@ -100,13 +103,15 @@ public void addBudgetAccountToALS(String client, String accountId) throws JsonPr RequestSpecification requestSpec = Utils.getDefaultSpec(); requestSpec.header("FSPIOP-Source", fspId); requestSpec.header("Date", getCurrentDateInFormat()); - requestSpec.header("Accept", "application/vnd.interoperability.participants+json;version=1"); - // requestSpec.header("Content-Type", "application/vnd.interoperability.participants+json;version=1.0"); + requestSpec.header("Accept", CONTENT_TYPE); String endpoint = mojaloopConfig.addUserToAlsEndpoint; - endpoint = endpoint.replaceAll("\\{\\{identifierType\\}\\}", "MSISDN"); - endpoint = endpoint.replaceAll("\\{\\{identifier\\}\\}", accountId); - + String identifierType = "MSISDN"; + endpoint = Util.getFormattedEndpoint(endpoint, "{{identifierType}}", identifierType); + endpoint = Util.getFormattedEndpoint(endpoint, "{{identifier}}", accountId); + String identifierId = (scenarioScopeState.creditParty == null) ? scenarioScopeState.payeeIdentifier + : scenarioScopeState.creditParty; + endpoint = String.format(endpoint, identifierType, identifierId); String requestBody = mojaloopDef.setBodyAddAlsUser(fspId); logger.info(mojaloopConfig.mojaloopBaseurl); diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferDef.java index d00c44a95..4bdc7621b 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferDef.java @@ -155,7 +155,7 @@ protected String setBodySavingsAccount(String client) throws JsonProcessingExcep // Getting resourceId and clientId PostClientsResponse createPayerClientResponse; - if (client.equals("payer")) { + if (("payer").equals(client)) { createPayerClientResponse = objectMapper.readValue(responsePayerClient, PostClientsResponse.class); } else { createPayerClientResponse = objectMapper.readValue(responsePayeeClient, PostClientsResponse.class); @@ -243,10 +243,6 @@ protected String setBodyClient(String client) throws JsonProcessingException { return setBodyPayerClient(); } else if (client.equals("payee")) { return setBodyPayeeClient(); - } else if (client.equals("payee2")) { - return setBodyPayeeClient(); - } else if (client.equals("payee3")) { - return setBodyPayeeClient(); } return client; } diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java index 9467919c7..4d2bfdbbf 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java @@ -33,6 +33,7 @@ import org.mifos.integrationtest.common.Utils; import org.mifos.integrationtest.config.MojaloopConfig; import org.mifos.integrationtest.config.PayerFundTransferConfig; +import org.mifos.integrationtest.util.Util; import org.springframework.beans.factory.annotation.Autowired; public class PayerFundTransferStepDef extends BaseStepDef { @@ -105,7 +106,7 @@ public void callCreateClientEndpoint(String client) throws JsonProcessingExcepti .expect().spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when().post(transferConfig.clientEndpoint) .andReturn().asString(); - if (client.equals("payer")) { + if ("payer".equals(client)) { fundTransferDef.responsePayerClient = clientResponse; assertThat(fundTransferDef.responsePayerClient).isNotEmpty(); } else { @@ -160,7 +161,7 @@ public void callCreateInteropIdentifierEndpoint(String client) throws JsonProces fundTransferDef.interopIdentifierBody = fundTransferDef.setBodyInteropIdentifier(); // Setting account ID in path - String responseSavingsAccount = client.equals("payer") ? fundTransferDef.responseSavingsAccountPayer + String responseSavingsAccount = ("payer").equals(client) ? fundTransferDef.responseSavingsAccountPayer : fundTransferDef.responseSavingsAccountPayee; PostSavingsAccountsResponse savingsAccountResponse = objectMapper.readValue(responseSavingsAccount, @@ -196,7 +197,7 @@ public void callCreateInteropBudgetIdentifierEndpoint(String client, String acco fundTransferDef.interopIdentifierBody = fundTransferDef.setBodyInteropIdentifier(); // Setting account ID in path - String responseSavingsAccount = client.equals("payer") ? fundTransferDef.responseSavingsAccountPayer + String responseSavingsAccount = ("payer").equals(client) ? fundTransferDef.responseSavingsAccountPayer : fundTransferDef.responseSavingsAccountPayee; PostSavingsAccountsResponse savingsAccountResponse = objectMapper.readValue(responseSavingsAccount, @@ -212,8 +213,9 @@ public void callCreateInteropBudgetIdentifierEndpoint(String client, String acco } String endpoint = transferConfig.interopIdentifierEndpoint; - endpoint = endpoint.replaceAll("\\{\\{identifierType\\}\\}", "MSISDN"); - endpoint = endpoint.replaceAll("\\{\\{identifier\\}\\}", accountId); + String identifierType = "MSISDN"; + endpoint = Util.getFormattedEndpoint(endpoint, "{{identifierType}}", identifierType); + endpoint = Util.getFormattedEndpoint(endpoint, "{{identifier}}", accountId); // Calling Interop Identifier endpoint fundTransferDef.responseInteropIdentifier = RestAssured.given(requestSpec).baseUri(transferConfig.savingsBaseUrl) @@ -640,9 +642,9 @@ public void addRowToCsvFileForCombinedTestCases(String paymentMode, int transfer scenarioScopeState.gsmaP2PAmtDebitForBatch[id + 1] = transferAmount; } - @When("I create and setup a {string} with id {string} and account balance of {int} for all combine test cases") - public void consolidatedPayeeCreationStepsForAllCombinedTestsCases(String client, String id, int amount) throws JsonProcessingException { + public void consolidatedPayeeCreationStepsForAllCombinedTestsCases(String client, String id, int amount) + throws JsonProcessingException { setTenantForPayer(client); callCreateClientEndpoint(client); callCreateSavingsProductEndpoint(client); @@ -658,7 +660,7 @@ public void consolidatedPayeeCreationStepsForAllCombinedTestsCases(String client scenarioScopeState.initialBalForPayerForBatch[Integer.parseInt(id)] = amount; assertThat(scenarioScopeState.initialBalForPayerForBatch[Integer.parseInt(id)]).isNotNull(); - } else if (client.equals("payee")) { + } else if (("payee").equals(client)) { if (scenarioScopeState.initialBalForPayeeForBatch == null || id.equals("1")) { scenarioScopeState.initialBalForPayeeForBatch = new int[14]; } @@ -681,7 +683,6 @@ public void addRowToCsvFileForAllCombinedTestCases(String paymentMode, int trans scenarioScopeState.gsmaP2PAmtDebitForBatch[id + 1] = transferAmount; } - @Then("add last row to csv with current payer and payee, payment mode as {string} and transfer amount {int} and id {int}") public void addLastRowToCsvFile(String paymentMode, int transferAmount, int id) throws IOException { @@ -704,14 +705,14 @@ public void consolidatedPayeeCreationSteps(String client, String id, int amount) callApproveSavingsEndpoint("approve", client); callSavingsActivateEndpoint("activate", client); callDepositAccountEndpoint("deposit", amount, client); - if (client.equals("payer")) { + if (("payer").equals(client)) { if (scenarioScopeState.initialBalForPayerForBatch == null) { scenarioScopeState.initialBalForPayerForBatch = new int[4]; } scenarioScopeState.initialBalForPayerForBatch[Integer.parseInt(id)] = amount; assertThat(scenarioScopeState.initialBalForPayerForBatch[Integer.parseInt(id)]).isNotNull(); - } else if (client.equals("payee")) { + } else if (("payee").equals(client)) { if (scenarioScopeState.initialBalForPayeeForBatch == null) { scenarioScopeState.initialBalForPayeeForBatch = new int[4]; } diff --git a/src/test/java/org/mifos/integrationtest/util/Util.java b/src/test/java/org/mifos/integrationtest/util/Util.java new file mode 100644 index 000000000..f1507e39e --- /dev/null +++ b/src/test/java/org/mifos/integrationtest/util/Util.java @@ -0,0 +1,12 @@ +package org.mifos.integrationtest.util; + +public final class Util { + + private Util() { + throw new UnsupportedOperationException("Utility class"); + } + + public static String getFormattedEndpoint(String formattedTemplate, String tobeReplaced, String replacedWith) { + return formattedTemplate.replace(tobeReplaced, replacedWith); + } +} diff --git a/src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoop.csv b/src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoop.csv deleted file mode 100644 index 56cf0f79d..000000000 --- a/src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoop.csv +++ /dev/null @@ -1,9 +0,0 @@ -id,request_id,payment_mode,payer_identifier_type,payer_identifier,payee_identifier_type,payee_identifier,amount,currency,note -0,3e2dcaf6-7f66-4460-aa03-2be3a12222eb,closedloop,msisdn,5397,msisdn,5141,10,USD,Test Payee Payment -1,b9760d58-676a-4353-a555-3a3b63f1760a,closedloop,msisdn,5398,msisdn,5142,5,USD,Test Payee Payment -2,00ffd1a8-c7a7-4943-b68f-11df7c2763a5,closedloop,msisdn,5399,msisdn,5143,5,USD,Test Payee Payment -3,74a81c70-0335-45b9-877b-43b3b6ec2f16,closedloop,msisdn,5400,msisdn,5144,5,USD,Test Payee Payment -4,777035ca-a4d9-4725-b905-0c840b567c51,closedloop,msisdn,5401,msisdn,5145,5,USD,Test Payee Payment -5,f50f0d85-7fec-44ad-8a3f-0811b4926db6,gsma,msisdn,5402,msisdn,5146,6,USD,Test Payee Payment -6,9c780986-28a9-45eb-896e-1139ef2a15c2,gsma,msisdn,5403,msisdn,5147,7,USD,Test Payee Payment -7,09abfde9-73c8-45d9-a89c-9623eacddcd3,gsma,msisdn,5404,msisdn,5148,8,USD,Test Payee Payment diff --git a/src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoopMojaloop.csv b/src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoopMojaloop.csv deleted file mode 100644 index cc812093b..000000000 --- a/src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoopMojaloop.csv +++ /dev/null @@ -1,14 +0,0 @@ -id,request_id,payment_mode,payer_identifier_type,payer_identifier,payee_identifier_type,payee_identifier,amount,currency,note -0,c36e35ea-bdfc-4e6f-b312-3c598f527447,closedloop,msisdn,2311,msisdn,1767,10,USD,Test Payee Payment -1,b03f5f6a-6c51-4c6f-9b8a-6ea5db515bf4,closedloop,msisdn,2312,msisdn,1768,5,USD,Test Payee Payment -2,a7f4bf74-297e-4b31-821e-db453f0199da,closedloop,msisdn,2313,msisdn,1769,5,USD,Test Payee Payment -3,4322ed84-e4c5-4536-926e-659d9aac2e18,closedloop,msisdn,2314,msisdn,1770,5,USD,Test Payee Payment -4,0af8d8c8-3c79-4f2c-9a61-00afd545e2a8,closedloop,msisdn,2315,msisdn,1771,5,USD,Test Payee Payment -5,4c746765-3fab-46b0-85fb-28d8882636f0,gsma,msisdn,2316,msisdn,1772,6,USD,Test Payee Payment -6,86e3f820-c795-45f0-91ef-1362a4d37df5,gsma,msisdn,2318,msisdn,1774,7,USD,Test Payee Payment -7,8e539370-8397-4a34-a16d-00a755515686,gsma,msisdn,2319,msisdn,1775,8,USD,Test Payee Payment -8,b5853d34-e828-4644-ae34-abe10e4a1547,gsma,msisdn,2321,msisdn,1776,9,USD,Test Payee Payment -9,504fbd96-60d6-4e7c-837b-e687e210fa75,gsma,msisdn,2322,msisdn,1777,10,USD,Test Payee Payment -10,e89e2900-c1bb-458b-ba1f-0a8d182e33f7,mojaloop,msisdn,2324,msisdn,1778,3,USD,Test Payee Payment -11,08d93b60-92e9-4667-a279-77c452566f22,mojaloop,msisdn,2325,msisdn,1778,2,USD,Test Payee Payment -12,bb6375d2-aa2f-4b68-b53d-cf73f4b6a47e,mojaloop,msisdn,2326,msisdn,1779,1,USD,Test Payee Payment \ No newline at end of file diff --git a/src/test/java/resources/batch_demo_csv/bulk_payment2.csv b/src/test/java/resources/batch_demo_csv/bulk_payment2.csv deleted file mode 100644 index 69d14b641..000000000 --- a/src/test/java/resources/batch_demo_csv/bulk_payment2.csv +++ /dev/null @@ -1,7 +0,0 @@ -id,request_id,payment_mode,payer_identifier_type,payer_identifier,payee_identifier_type,payee_identifier,amount,currency,note -0,g1e22fe3-9740-4fba-97b6-78f43bfa7f2f,closedloop,accountNumber,003001003879112168,accountNumber,500173110196,840,USD,Test Payee Payment -1,72aa3ea4-e6f6-4880-877f-39f6ac4d052e,closedloop,accountNumber,003001003879112168,accountNumber,500174120160,242,USD,Test Payee Payment -2,f1e22fe3-9740-4fba-97b6-78f43bfa7f0f,closedloop,accountNumber,003001003879112168,accountNumber,500173110195,830,USD,Test Payee Payment -3,q1e22fe3-9740-4fba-97b6-78f43bfa7f2f,closedloop,accountNumber,003001003879112168,accountNumber,500173110196,740,USD,Test Payee Payment -4,a2aa3ea4-e6f6-4880-877f-39f6ac4d052e,closedloop,accountNumber,003001003879112168,accountNumber,500174120160,132,USD,Test Payee Payment -5,z1e22fe3-9740-4fba-97b6-78f43bfa7f0f,closedloop,accountNumber,003001003879112168,accountNumber,500173110195,730,USD,Test Payee Payment diff --git a/src/test/java/resources/bulkPayment.feature b/src/test/java/resources/bulkPayment.feature index 7c24b2e75..515bca356 100644 --- a/src/test/java/resources/bulkPayment.feature +++ b/src/test/java/resources/bulkPayment.feature @@ -40,7 +40,7 @@ Feature: Test ability to make payment to individual with bank account Then I call the deposit account endpoint with command "deposit" for amount 9000 for "payer" Then I add "payer" with account id "323456789" to als - Given I have Fineract-Platform-TenantId for "payee" + Given I have Fineract-Platform-TenantId for "payee1" When I call the create client endpoint for "payee" Then I call the create savings product endpoint for "payee" When I call the create savings account endpoint for "payee" @@ -49,7 +49,7 @@ Feature: Test ability to make payment to individual with bank account Then I approve the deposit for Budget Account with command "approve" for "payee" When I activate the budget account with command "activate" for "payee" Then I call the deposit account endpoint with command "deposit" for amount 1000 for "payee" - Then I add "payee" with account id "1234" to als + Then I add "payee1" with account id "1234" to als Given I have Fineract-Platform-TenantId for "payee2" When I call the create client endpoint for "payee" From be964b240995d247a6dd4d9e478f88b67d1fc1df Mon Sep 17 00:00:00 2001 From: Abhinav Mishra Date: Thu, 11 Jul 2024 12:28:51 +0530 Subject: [PATCH 13/15] Addressed Review Comments --- .github/workflows/jit-security.yml | 53 ++++++++++--------- .../cucumber/stepdef/GSMATransferStepDef.java | 30 +++++------ .../cucumber/stepdef/MojaloopStepDef.java | 2 +- .../stepdef/PayerFundTransferStepDef.java | 27 +++++----- 4 files changed, 57 insertions(+), 55 deletions(-) diff --git a/.github/workflows/jit-security.yml b/.github/workflows/jit-security.yml index 35081f292..d3babba2a 100644 --- a/.github/workflows/jit-security.yml +++ b/.github/workflows/jit-security.yml @@ -21,7 +21,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-trivy-alpine:latest - + enrich: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'enrich' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-enrichment-code' runs-on: ubuntu-22.04 @@ -31,7 +31,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-enrichment-slim:latest - + iac-misconfig-detection-kubernetes: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'iac-misconfig-detection-kubernetes' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-kubernetes-iac-misconfiguration-detection' runs-on: ubuntu-22.04 @@ -41,7 +41,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-kubescape-slim:latest - + remediation-pr: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'remediation-pr' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-remediation-pr' runs-on: ubuntu-22.04 @@ -51,7 +51,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/open-remediation-pr-alpine:latest - + secret-detection: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'secret-detection' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-secret-detection' runs-on: ubuntu-22.04 @@ -61,7 +61,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-gitleaks-alpine:latest - + software-bill-of-materials: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-bill-of-materials' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sbom' runs-on: ubuntu-22.04 @@ -72,7 +72,7 @@ jobs: with: security_control: registry.jit.io/control-syft-alpine:latest fail_if_cannot_checkout: false - + software-component-analysis-elixir: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-elixir' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -82,7 +82,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-osv-scanner-alpine:latest - + software-component-analysis-go: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-go' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -92,7 +92,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-nancy-alpine:latest - + software-component-analysis-gradle: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-gradle' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -102,7 +102,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-jit-gradle-scanner:latest - + software-component-analysis-java: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-java' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -112,7 +112,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-osv-scanner-alpine:latest - + software-component-analysis-js: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-js' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -122,7 +122,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-npm-audit-slim:latest - + software-component-analysis-php: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-php' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -132,7 +132,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-osv-scanner-alpine:latest - + software-component-analysis-poetry: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-poetry' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -142,7 +142,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-osv-scanner-alpine:latest - + software-component-analysis-python: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-python' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -152,7 +152,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-osv-scanner-alpine:latest - + software-component-analysis-trivy-csharp: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-trivy-csharp' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -162,7 +162,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-trivy-dotnet-slim:latest - + static-code-analysis-c-cpp: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-c-cpp' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -172,7 +172,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-csharp: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-csharp' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -182,7 +182,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-go: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-go' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -192,7 +192,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-gosec-alpine:latest - + static-code-analysis-java: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-java' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -202,7 +202,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-js: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-js' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -212,7 +212,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-kotlin: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-kotlin' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -222,7 +222,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-php: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-php' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -232,7 +232,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-python-semgrep: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-python-semgrep' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -242,7 +242,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-ruby: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-ruby' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -252,7 +252,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-rust: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-rust' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -262,7 +262,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-scala: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-scala' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -272,7 +272,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-swift: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-swift' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -282,3 +282,4 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest + \ No newline at end of file diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferStepDef.java index 1fdc0a06c..3b0c2a380 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferStepDef.java @@ -432,10 +432,10 @@ public void iCallTheBalanceApiForPayerBalance() throws JsonProcessingException { finalEndpoint = finalEndpoint.replace("{IdentifierType}", "MSISDN"); finalEndpoint = finalEndpoint.replace("{IdentifierId}", scenarioScopeState.debitParty.isEmpty() ? scenarioScopeState.payerIdentifier : scenarioScopeState.debitParty); - logger.info("Endpoint: " + finalEndpoint); + logger.info("Endpoint: {}", finalEndpoint); scenarioScopeState.response = RestAssured.given(requestSpec).baseUri(amsBaseUrl).body("").expect() .spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when().get(finalEndpoint).andReturn().asString(); - logger.info("Balance Response: " + scenarioScopeState.response); + logger.info("Balance Response: {}", scenarioScopeState.response); InteropAccountDTO interopAccountDTO = objectMapper.readValue(scenarioScopeState.response, InteropAccountDTO.class); assertThat(interopAccountDTO.getAvailableBalance().intValue() <= scenarioScopeState.initialBalForPayer).isTrue(); scenarioScopeState.gsmaP2PAmtDebit = 0; @@ -449,10 +449,10 @@ public void iCallTheBalanceApiForPayeeBalance() throws JsonProcessingException { finalEndpoint = finalEndpoint.replace("{IdentifierType}", "MSISDN"); finalEndpoint = finalEndpoint.replace("{IdentifierId}", scenarioScopeState.creditParty.isEmpty() ? scenarioScopeState.payeeIdentifier : scenarioScopeState.creditParty); - logger.info("Endpoint: " + finalEndpoint); + logger.info("Endpoint: {}", finalEndpoint); scenarioScopeState.response = RestAssured.given(requestSpec).baseUri(amsBaseUrl).body("").expect() .spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when().get(finalEndpoint).andReturn().asString(); - logger.info("Balance Response: " + scenarioScopeState.response); + logger.info("Balance Response: {}", scenarioScopeState.response); InteropAccountDTO interopAccountDTO = objectMapper.readValue(scenarioScopeState.response, InteropAccountDTO.class); assertThat(interopAccountDTO.getAvailableBalance().intValue() >= scenarioScopeState.initialBalForPayee).isTrue(); @@ -469,7 +469,7 @@ public void iCallTheBalanceApiForPayerBalanceAfterDebit() throws JsonProcessingE logger.info("Endpoint: " + finalEndpoint); scenarioScopeState.response = RestAssured.given(requestSpec).baseUri(amsBaseUrl).body("").expect() .spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when().get(finalEndpoint).andReturn().asString(); - logger.info("Balance Response: " + scenarioScopeState.response); + logger.info("Balance Response: {}", scenarioScopeState.response); InteropAccountDTO interopAccountDTO = objectMapper.readValue(scenarioScopeState.response, InteropAccountDTO.class); assertThat(interopAccountDTO.getAvailableBalance().intValue() == scenarioScopeState.initialBalForPayer - scenarioScopeState.gsmaP2PAmtDebit).isTrue(); @@ -485,10 +485,10 @@ public void iCallTheBalanceApiForPayeeBalanceAfterCredit() throws JsonProcessing finalEndpoint = finalEndpoint.replace("{IdentifierType}", "MSISDN"); finalEndpoint = finalEndpoint.replace("{IdentifierId}", scenarioScopeState.creditParty.isEmpty() ? scenarioScopeState.payeeIdentifier : scenarioScopeState.creditParty); - logger.info("Endpoint: " + finalEndpoint); + logger.info("Endpoint: {}", finalEndpoint); scenarioScopeState.response = RestAssured.given(requestSpec).baseUri(amsBaseUrl).body("").expect() .spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when().get(finalEndpoint).andReturn().asString(); - logger.info("Balance Response: " + scenarioScopeState.response); + logger.info("Balance Response: {}", scenarioScopeState.response); InteropAccountDTO interopAccountDTO = objectMapper.readValue(scenarioScopeState.response, InteropAccountDTO.class); assertThat(interopAccountDTO.getAvailableBalance().intValue() == scenarioScopeState.initialBalForPayee + scenarioScopeState.gsmaP2PAmtDebit).isTrue(); @@ -691,7 +691,7 @@ public void iCallTheBalanceApiForPayeeBalance(String id) throws JsonProcessingEx logger.info("Endpoint: " + finalEndpoint); scenarioScopeState.response = RestAssured.given(requestSpec).baseUri(amsBaseUrl).body("").expect() .spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when().get(finalEndpoint).andReturn().asString(); - logger.info("Balance Response: " + scenarioScopeState.response); + logger.info("Balance Response: {}", scenarioScopeState.response); InteropAccountDTO interopAccountDTO = objectMapper.readValue(scenarioScopeState.response, InteropAccountDTO.class); assertThat( interopAccountDTO.getAvailableBalance().intValue() >= scenarioScopeState.initialBalForPayeeForBatch[Integer.parseInt(id)]) @@ -713,7 +713,7 @@ public void iCallTheBalanceApiForPayeeBalanceForCombinedTestsCases(String id) th logger.info("Endpoint: " + finalEndpoint); scenarioScopeState.response = RestAssured.given(requestSpec).baseUri(amsBaseUrl).body("").expect() .spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when().get(finalEndpoint).andReturn().asString(); - logger.info("Balance Response: " + scenarioScopeState.response); + logger.info("Balance Response: {}", scenarioScopeState.response); InteropAccountDTO interopAccountDTO = objectMapper.readValue(scenarioScopeState.response, InteropAccountDTO.class); assertThat( interopAccountDTO.getAvailableBalance().intValue() >= scenarioScopeState.initialBalForPayeeForBatch[Integer.parseInt(id)]) @@ -735,7 +735,7 @@ public void iCallTheBalanceApiForAllPayerBalanceForCombinedTestCases(String id) logger.info("Endpoint: {} ", finalEndpoint); scenarioScopeState.response = RestAssured.given(requestSpec).baseUri(amsBaseUrl).body("").expect() .spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when().get(finalEndpoint).andReturn().asString(); - logger.info("Balance Response: " + scenarioScopeState.response); + logger.info("Balance Response: {}", scenarioScopeState.response); InteropAccountDTO interopAccountDTO = objectMapper.readValue(scenarioScopeState.response, InteropAccountDTO.class); assertThat( interopAccountDTO.getAvailableBalance().intValue() >= scenarioScopeState.initialBalForPayerForBatch[Integer.parseInt(id)]) @@ -777,7 +777,7 @@ public void iCallTheBalanceApiForPayeeBalanceForAllCombinedTestsCases(String id) logger.info("Endpoint: {}", finalEndpoint); scenarioScopeState.response = RestAssured.given(requestSpec).baseUri(amsBaseUrl).body("").expect() .spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when().get(finalEndpoint).andReturn().asString(); - logger.info("Balance Response: " + scenarioScopeState.response); + logger.info("Balance Response: {}", scenarioScopeState.response); InteropAccountDTO interopAccountDTO = objectMapper.readValue(scenarioScopeState.response, InteropAccountDTO.class); assertThat( interopAccountDTO.getAvailableBalance().intValue() >= scenarioScopeState.initialBalForPayeeForBatch[Integer.parseInt(id)]) @@ -797,7 +797,7 @@ public void iCallTheBalanceApiForPayeeBalanceAfterCredit(String id) throws JsonP logger.info("Endpoint: {}", finalEndpoint); scenarioScopeState.response = RestAssured.given(requestSpec).baseUri(amsBaseUrl).body("").expect() .spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when().get(finalEndpoint).andReturn().asString(); - logger.info("Balance Response: " + scenarioScopeState.response); + logger.info("Balance Response: {}", scenarioScopeState.response); InteropAccountDTO interopAccountDTO = objectMapper.readValue(scenarioScopeState.response, InteropAccountDTO.class); assertThat(interopAccountDTO.getAvailableBalance().intValue() == scenarioScopeState.initialBalForPayeeForBatch[Integer.parseInt(id)] + scenarioScopeState.gsmaP2PAmtDebitForBatch[Integer.parseInt(id)]).isTrue(); @@ -816,7 +816,7 @@ public void iCallTheBalanceApiForPayerBalance(String id) throws JsonProcessingEx logger.info("Endpoint: " + finalEndpoint); scenarioScopeState.response = RestAssured.given(requestSpec).baseUri(amsBaseUrl).body("").expect() .spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when().get(finalEndpoint).andReturn().asString(); - logger.info("Balance Response: " + scenarioScopeState.response); + logger.info("Balance Response: {}", scenarioScopeState.response); InteropAccountDTO interopAccountDTO = objectMapper.readValue(scenarioScopeState.response, InteropAccountDTO.class); assertThat( interopAccountDTO.getAvailableBalance().intValue() >= scenarioScopeState.initialBalForPayerForBatch[Integer.parseInt(id)]) @@ -838,7 +838,7 @@ public void iCallTheBalanceApiForPayerBalanceForCombinedTestCases(String id) thr logger.info("Endpoint: " + finalEndpoint); scenarioScopeState.response = RestAssured.given(requestSpec).baseUri(amsBaseUrl).body("").expect() .spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when().get(finalEndpoint).andReturn().asString(); - logger.info("Balance Response: " + scenarioScopeState.response); + logger.info("Balance Response: {}", scenarioScopeState.response); InteropAccountDTO interopAccountDTO = objectMapper.readValue(scenarioScopeState.response, InteropAccountDTO.class); assertThat( interopAccountDTO.getAvailableBalance().intValue() >= scenarioScopeState.initialBalForPayerForBatch[Integer.parseInt(id)]) @@ -855,7 +855,7 @@ public void iCallTheBalanceApiForPayerBalanceAfterDebit(String id) throws JsonPr logger.info("Endpoint: " + finalEndpoint); scenarioScopeState.response = RestAssured.given(requestSpec).baseUri(amsBaseUrl).body("").expect() .spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when().get(finalEndpoint).andReturn().asString(); - logger.info("Balance Response: " + scenarioScopeState.response); + logger.info("Balance Response: {}", scenarioScopeState.response); InteropAccountDTO interopAccountDTO = objectMapper.readValue(scenarioScopeState.response, InteropAccountDTO.class); int originBal = scenarioScopeState.initialBalForPayerForBatch[Integer.parseInt(id)]; int debitAmt = scenarioScopeState.gsmaP2PAmtDebitForBatch[Integer.parseInt(id)]; diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java index 4feb8d7b2..c1ce820d5 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java @@ -120,7 +120,7 @@ public void addBudgetAccountToALS(String client, String accountId) throws JsonPr String response = RestAssured.given(requestSpec).baseUri(mojaloopConfig.mojaloopBaseurl) .config(RestAssured.config().encoderConfig(encoderConfig().appendDefaultContentCharsetToContentTypeIfUndefined(false))) - .body(requestBody).contentType("application/vnd.interoperability.participants+json;version=1.0").expect() + .body(requestBody).contentType(CONTENT_TYPE).expect() .spec(new ResponseSpecBuilder().expectStatusCode(202).build()).when().post(endpoint).andReturn().asString(); logger.info(response); diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java index 4d2bfdbbf..373b8f6d2 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java @@ -185,7 +185,7 @@ public void callCreateInteropIdentifierEndpoint(String client) throws JsonProces .body(fundTransferDef.interopIdentifierBody).expect().spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when() .post(endpoint).andReturn().asString(); - logger.info("Interop Identifier Response: " + fundTransferDef.responseInteropIdentifier); + logger.info("Interop Identifier Response: {}", fundTransferDef.responseInteropIdentifier); assertThat(fundTransferDef.responseInteropIdentifier).isNotEmpty(); } @@ -222,7 +222,7 @@ public void callCreateInteropBudgetIdentifierEndpoint(String client, String acco .body(fundTransferDef.interopIdentifierBody).expect().spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when() .post(endpoint).andReturn().asString(); - logger.info("Interop Identifier Response: " + fundTransferDef.responseInteropIdentifier); + logger.info("Interop Identifier Response: {}", fundTransferDef.responseInteropIdentifier); assertThat(fundTransferDef.responseInteropIdentifier).isNotEmpty(); } @@ -246,7 +246,7 @@ public void callApproveSavingsEndpoint(String command, String client) throws Jso .body(fundTransferDef.savingsApproveBody).expect().spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when() .post(endpoint).andReturn().asString(); - logger.info("Savings Approve Response: " + fundTransferDef.responseSavingsApprove); + logger.info("Savings Approve Response: {}", fundTransferDef.responseSavingsApprove); assertThat(fundTransferDef.responseSavingsApprove).isNotEmpty(); } @@ -260,9 +260,9 @@ public void callApproveBudgetAccountEndpoint(String command, String client) thro String endpoint = transferConfig.savingsApproveEndpoint; if (client.equals("payer")) { - endpoint = endpoint.replaceAll("\\{\\{savingsAccId\\}\\}", savings_account_id); + endpoint = Util.getFormattedEndpoint(endpoint, "{{savingsAccId}}", savings_account_id); } else { - endpoint = endpoint.replaceAll("\\{\\{savingsAccId\\}\\}", savings_account_id); + endpoint = Util.getFormattedEndpoint(endpoint, "{{savingsAccId}}", savings_account_id); } // Calling create loan account endpoint @@ -270,7 +270,7 @@ public void callApproveBudgetAccountEndpoint(String command, String client) thro .body(fundTransferDef.savingsApproveBody).expect().spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when() .post(endpoint).andReturn().asString(); - logger.info("Savings Approve Response: " + fundTransferDef.responseSavingsApprove); + logger.info("Savings Approve Response: {}", fundTransferDef.responseSavingsApprove); assertThat(fundTransferDef.responseSavingsApprove).isNotEmpty(); } @@ -293,7 +293,7 @@ public void callSavingsActivateEndpoint(String command, String client) throws Js .body(fundTransferDef.savingsActivateBody).expect().spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when() .post(endpoint).andReturn().asString(); - logger.info("Savings Activate Response: " + fundTransferDef.responseSavingsActivate); + logger.info("Savings Activate Response: {}", fundTransferDef.responseSavingsActivate); assertThat(fundTransferDef.responseSavingsActivate).isNotEmpty(); } @@ -307,16 +307,16 @@ public void callBudgetAccountActivateEndpoint(String command, String client) thr String endpoint = transferConfig.savingsActivateEndpoint; if (client.equals("payer")) { - endpoint = endpoint.replaceAll("\\{\\{savingsAccId\\}\\}", savings_account_id); + endpoint = Util.getFormattedEndpoint(endpoint, "{{savingsAccId}}", savings_account_id); } else { - endpoint = endpoint.replaceAll("\\{\\{savingsAccId\\}\\}", savings_account_id); + endpoint = Util.getFormattedEndpoint(endpoint, "{{savingsAccId}}", savings_account_id); } // Calling create loan account endpoint fundTransferDef.responseSavingsActivate = RestAssured.given(requestSpec).baseUri(transferConfig.savingsBaseUrl) .body(fundTransferDef.savingsActivateBody).expect().spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when() .post(endpoint).andReturn().asString(); - logger.info("Savings Activate Response: " + fundTransferDef.responseSavingsActivate); + logger.info("Savings Activate Response: {}", fundTransferDef.responseSavingsActivate); assertThat(fundTransferDef.responseSavingsActivate).isNotEmpty(); } @@ -754,8 +754,9 @@ public void budgetAccountExistsWithAccoundId(String accountId) throws JsonProces // Setting account ID in path String endpoint = transferConfig.interopIdentifierEndpoint; - endpoint = endpoint.replaceAll("\\{\\{identifierType\\}\\}", "MSISDN"); - endpoint = endpoint.replaceAll("\\{\\{identifier\\}\\}", accountId); + String identifierType = "MSISDN"; + endpoint = Util.getFormattedEndpoint(endpoint, "{{identifierType}}", identifierType); + endpoint = Util.getFormattedEndpoint(endpoint, "{{identifier}}", accountId); try { // Calling Interop Identifier endpoint fundTransferDef.responseInteropIdentifier = RestAssured.given(requestSpec).baseUri(transferConfig.savingsBaseUrl).expect() @@ -764,7 +765,7 @@ public void budgetAccountExistsWithAccoundId(String accountId) throws JsonProces logger.error("Error checking account existence: ", e); throw new RuntimeException("Failed to check account existence", e); } - logger.info("Interop Identifier Response: " + fundTransferDef.responseInteropIdentifier); + logger.info("Interop Identifier Response: {}", fundTransferDef.responseInteropIdentifier); assertThat(fundTransferDef.responseInteropIdentifier).isNotEmpty(); } From 5cca3d86840aa4a262d103c04fb056c8eff0927a Mon Sep 17 00:00:00 2001 From: Abhinav Mishra Date: Wed, 17 Jul 2024 15:13:44 +0530 Subject: [PATCH 14/15] Optimised Bulk test cases --- src/main/resources/application.yaml | 6 +- .../common/CollectionHelper.java | 4 +- .../common/TransferHelper.java | 2 +- .../cucumber/stepdef/BaseStepDef.java | 31 ++++- .../cucumber/stepdef/BatchApiStepDef.java | 2 +- .../cucumber/stepdef/ErrorCodeStepDef.java | 110 ++++++++-------- .../cucumber/stepdef/GSMATransferDef.java | 6 +- .../stepdef/IdentityMapperStepDef.java | 8 +- .../cucumber/stepdef/MojaloopDef.java | 6 +- .../stepdef/PayerFundTransferDef.java | 28 ++-- .../stepdef/PayerFundTransferStepDef.java | 67 +++++++--- .../cucumber/stepdef/ScenarioScopeState.java | 2 + src/test/java/resources/batch.feature | 2 +- ...ansactioClosedLoopMojaloopFundTransfer.csv | 16 +-- .../batch_demo_csv/batchTransaction.csv | 6 +- .../batch_demo_csv/batchTransactionGsma.csv | 6 +- .../batchTransactionGsmaClosedLoop.csv | 9 ++ .../resources/batch_demo_csv/bulk_payment.csv | 12 +- .../bulk_payment_closedl_mock_mojaloop.csv | 16 +-- .../batch_demo_csv/deduplication-test.csv | 6 +- ...ntifier-resolution-using-budgetAccount.csv | 20 +-- .../batch_demo_csv/ph-ee-bulk-demo-6.csv | 20 +-- .../batch_demo_csv/ph-ee-bulk-demo-7.csv | 6 +- .../ph-ee-bulk-demoErrorAsync-6.csv | 10 +- .../ph-ee-bulk-demoErrorSync-6.csv | 10 +- .../batch_demo_csv/ph-ee-bulk-splitting.csv | 24 ++-- src/test/java/resources/bulkPayment.feature | 123 ++++-------------- src/test/java/resources/mojaloop.feature | 8 +- 28 files changed, 280 insertions(+), 286 deletions(-) create mode 100644 src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoop.csv diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 07386015a..75fa22ab5 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -267,9 +267,9 @@ tenantconfig: fspconfig: payeefsp: - payeefsp1: "pluto" - payeefsp2: "venus" - payeefsp3: "jupiter" + payeefsp1: "jupiter" + payeefsp2: "pluto" + payeefsp3: "venus" payerfsp: payerfsp1: "wakanda" payerfsp2: "gorilla" diff --git a/src/test/java/org/mifos/integrationtest/common/CollectionHelper.java b/src/test/java/org/mifos/integrationtest/common/CollectionHelper.java index 6da79a960..f24674752 100644 --- a/src/test/java/org/mifos/integrationtest/common/CollectionHelper.java +++ b/src/test/java/org/mifos/integrationtest/common/CollectionHelper.java @@ -8,7 +8,7 @@ /** * { "payer": [ { "key": "MSISDN", "value": "254708374149" }, { "key": "ACCOUNTID", "value": "24450523" } ], "amount": { - * "amount": "1", "currency": "USD" }, "transactionType": { "scenario": "MPESA", "subScenario": "BUYGOODS", "initiator": + * "amount": "1", "currency": "TZS" }, "transactionType": { "scenario": "MPESA", "subScenario": "BUYGOODS", "initiator": * "PAYEE", "initiatorType": "BUSINESS" } } */ public final class CollectionHelper { @@ -60,7 +60,7 @@ private static JSONObject getPayerObject(String key, String value) throws JSONEx private static JSONObject getAmountObject(String amount) throws JSONException { JSONObject amountObject = new JSONObject(); - amountObject.put("currency", "USD"); + amountObject.put("currency", "TZS"); amountObject.put("amount", amount); return amountObject; } diff --git a/src/test/java/org/mifos/integrationtest/common/TransferHelper.java b/src/test/java/org/mifos/integrationtest/common/TransferHelper.java index 30d9211bd..d340e387a 100644 --- a/src/test/java/org/mifos/integrationtest/common/TransferHelper.java +++ b/src/test/java/org/mifos/integrationtest/common/TransferHelper.java @@ -47,7 +47,7 @@ private static JSONObject getPartyObject(String value) throws JSONException { private static JSONObject getAmountObject(String amount) throws JSONException { JSONObject amountObject = new JSONObject(); - amountObject.put("currency", "USD"); + amountObject.put("currency", "TZS"); amountObject.put("amount", amount); return amountObject; } diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/BaseStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/BaseStepDef.java index c00b55eb1..914ec0f31 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/BaseStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/BaseStepDef.java @@ -4,6 +4,9 @@ import io.cucumber.core.internal.com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.security.cert.X509Certificate; @@ -103,13 +106,35 @@ protected String generateSignature(String clientCorrelationId, String tenant, St throws IOException, NoSuchPaddingException, IllegalBlockSizeException, NoSuchAlgorithmException, BadPaddingException, InvalidKeySpecException, InvalidKeyException { - JsonWebSignature jsonWebSignature = new JsonWebSignature.JsonWebSignatureBuilder().setClientCorrelationId(clientCorrelationId) - .setTenantId(tenant).setIsDataAsFile(isDataAFile) - .setData(isDataAFile ? Utils.getAbsoluteFilePathToResource(scenarioScopeState.filename) : data).build(); + String filePathOrData = isDataAFile ? Utils.getAbsoluteFilePathToResource(scenarioScopeState.filename) : data; + + // Debug statements to check the values + System.out.println("Client Correlation ID: " + clientCorrelationId); + System.out.println("Tenant: " + tenant); + System.out.println("Is Data A File: " + isDataAFile); + System.out.println("Data or File Path: " + filePathOrData); + + // Read file content if it's a file + if (isDataAFile) { + String fileContent = new String(Files.readAllBytes(Paths.get(filePathOrData)), StandardCharsets.UTF_8); + System.out.println("File Content: " + fileContent); + } + + JsonWebSignature jsonWebSignature = new JsonWebSignature.JsonWebSignatureBuilder() + .setClientCorrelationId(clientCorrelationId) + .setTenantId(tenant) + .setIsDataAsFile(isDataAFile) + .setData(filePathOrData) + .build(); + + // More debug statements + System.out.println("Generated JsonWebSignature Object: " + jsonWebSignature); return jsonWebSignature.getSignature(scenarioScopeState.privateKeyString); } + + private void assertNonEmptyArray(List objects) { assertNotNull(objects); assertThat(objects).isNotEmpty(); diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/BatchApiStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/BatchApiStepDef.java index 174697c6a..c5ffce079 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/BatchApiStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/BatchApiStepDef.java @@ -553,7 +553,7 @@ public void batchTearDown() { public BatchRequestDTO mockBatchTransactionRequestDTO(String paymentMode) { BatchRequestDTO batchRequestDTO = new BatchRequestDTO(); batchRequestDTO.setAmount("100"); - batchRequestDTO.setCurrency("USD"); + batchRequestDTO.setCurrency("TZS"); batchRequestDTO.setPaymentMode(paymentMode); batchRequestDTO.setDescriptionText("Integration test"); batchRequestDTO.setRequestId(UUID.randomUUID().toString()); diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/ErrorCodeStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/ErrorCodeStepDef.java index b33f8d4c6..7425358b5 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/ErrorCodeStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/ErrorCodeStepDef.java @@ -176,19 +176,19 @@ public void iShouldBeAbleToParseErrorCodeFromGSMATransferResponse(String errorCo @Given("I can create GSMATransferDTO with missing currency details") public void iCanCreateGSMATransactionDTOWithMissingCurrency() { GSMATransferHelper gsmaTransferHelper = new GSMATransferHelper(); - Fee fee = gsmaTransferHelper.feeHelper("11", "USD", "string"); + Fee fee = gsmaTransferHelper.feeHelper("11", "TZS", "string"); GsmaParty debitParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "449999999"); GsmaParty creditParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "+449999112"); InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper - .internationalTransferInformationHelper("string", "string", "directtoaccount", "USA", "USA", "USA", "USA"); - IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "USA", "2022-09-28T12:51:19.260+00:00", + .internationalTransferInformationHelper("string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); + IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "Tanzania", "2022-09-28T12:51:19.260+00:00", "2022-09-28T12:51:19.260+00:00", "string", "string"); - PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "USA", "string", + PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "Tanzania", "string", "string"); SubjectName subjectName = gsmaTransferHelper.subjectNameHelper("string", "string", "string", "string", "string"); - Kyc senderKyc = gsmaTransferHelper.kycHelper("USA", "2000-11-20", "string", "string", "string", 'm', idDocument, "USA", "string", + Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", postalAddress, subjectName); - Kyc receiverKyc = gsmaTransferHelper.kycHelper("USA", "2000-11-20", "string", "string", "string", 'm', idDocument, "USA", "string", + Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", postalAddress, subjectName); try { gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("11", debitParty, creditParty, "", "string", "string", @@ -202,22 +202,22 @@ public void iCanCreateGSMATransactionDTOWithMissingCurrency() { @Given("I can create GSMATransferDTO with same payer and payee") public void iCanCreateGSMATransactionDTOWithSamePayerAndPayee() { GSMATransferHelper gsmaTransferHelper = new GSMATransferHelper(); - Fee fee = gsmaTransferHelper.feeHelper("11", "USD", "string"); + Fee fee = gsmaTransferHelper.feeHelper("11", "TZS", "string"); GsmaParty debitParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "+449999112"); GsmaParty creditParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "+449999112"); InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper - .internationalTransferInformationHelper("string", "string", "directtoaccount", "USA", "USA", "USA", "USA"); - IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "USA", "2022-09-28T12:51:19.260+00:00", + .internationalTransferInformationHelper("string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); + IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "Tanzania", "2022-09-28T12:51:19.260+00:00", "2022-09-28T12:51:19.260+00:00", "string", "string"); - PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "USA", "string", + PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "Tanzania", "string", "string"); SubjectName subjectName = gsmaTransferHelper.subjectNameHelper("string", "string", "string", "string", "string"); - Kyc senderKyc = gsmaTransferHelper.kycHelper("USA", "2000-11-20", "string", "string", "string", 'm', idDocument, "USA", "string", + Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", postalAddress, subjectName); - Kyc receiverKyc = gsmaTransferHelper.kycHelper("USA", "2000-11-20", "string", "string", "string", 'm', idDocument, "USA", "string", + Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", postalAddress, subjectName); try { - gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("11", debitParty, creditParty, "USD", "string", "string", + gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("11", debitParty, creditParty, "TZS", "string", "string", "string", "transfer", "string", fee, "37.423825,-122.082900", internationalTransferInformation, "string", receiverKyc, senderKyc, "string", "2023-01-12T12:51:19.260+00:00"); } catch (JSONException e) { @@ -228,22 +228,22 @@ public void iCanCreateGSMATransactionDTOWithSamePayerAndPayee() { @Given("I can create GSMATransferDTO with Negative Amount") public void iCanCreateGSMATransactionDTOWithNegativeAmount() { GSMATransferHelper gsmaTransferHelper = new GSMATransferHelper(); - Fee fee = gsmaTransferHelper.feeHelper("11", "USD", "string"); + Fee fee = gsmaTransferHelper.feeHelper("11", "TZS", "string"); GsmaParty debitParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "+449999999"); GsmaParty creditParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "+449999112"); InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper - .internationalTransferInformationHelper("string", "string", "directtoaccount", "USA", "USA", "USA", "USA"); - IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "USA", "2022-09-28T12:51:19.260+00:00", + .internationalTransferInformationHelper("string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); + IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "Tanzania", "2022-09-28T12:51:19.260+00:00", "2022-09-28T12:51:19.260+00:00", "string", "string"); - PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "USA", "string", + PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "Tanzania", "string", "string"); SubjectName subjectName = gsmaTransferHelper.subjectNameHelper("string", "string", "string", "string", "string"); - Kyc senderKyc = gsmaTransferHelper.kycHelper("USA", "2000-11-20", "string", "string", "string", 'm', idDocument, "USA", "string", + Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", postalAddress, subjectName); - Kyc receiverKyc = gsmaTransferHelper.kycHelper("USA", "2000-11-20", "string", "string", "string", 'm', idDocument, "USA", "string", + Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", postalAddress, subjectName); try { - gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("-11", debitParty, creditParty, "USD", "string", "string", + gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("-11", debitParty, creditParty, "TZS", "string", "string", "string", "transfer", "string", fee, "37.423825,-122.082900", internationalTransferInformation, "string", receiverKyc, senderKyc, "string", "2023-01-12T12:51:19.260+00:00"); } catch (JSONException e) { @@ -255,22 +255,22 @@ public void iCanCreateGSMATransactionDTOWithNegativeAmount() { @Given("I can create GSMATransferDTO with invalid amount format") public void iCanCreateGSMATransactionDTOWithInvalidAmountFormat() { GSMATransferHelper gsmaTransferHelper = new GSMATransferHelper(); - Fee fee = gsmaTransferHelper.feeHelper("11", "USD", "string"); + Fee fee = gsmaTransferHelper.feeHelper("11", "TZS", "string"); GsmaParty debitParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "449999999"); GsmaParty creditParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "+449999112"); InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper - .internationalTransferInformationHelper("string", "string", "directtoaccount", "USA", "USA", "USA", "USA"); - IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "USA", "2022-09-28T12:51:19.260+00:00", + .internationalTransferInformationHelper("string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); + IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "Tanzania", "2022-09-28T12:51:19.260+00:00", "2022-09-28T12:51:19.260+00:00", "string", "string"); - PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "USA", "string", + PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "Tanzania", "string", "string"); SubjectName subjectName = gsmaTransferHelper.subjectNameHelper("string", "string", "string", "string", "string"); - Kyc senderKyc = gsmaTransferHelper.kycHelper("USA", "2000-11-20", "string", "string", "string", 'm', idDocument, "USA", "string", + Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", postalAddress, subjectName); - Kyc receiverKyc = gsmaTransferHelper.kycHelper("USA", "2000-11-20", "string", "string", "string", 'm', idDocument, "USA", "string", + Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", postalAddress, subjectName); try { - gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("ab", debitParty, creditParty, "USD", "string", "string", + gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("ab", debitParty, creditParty, "TZS", "string", "string", "string", "transfer", "string", fee, "37.423825,-122.082900", internationalTransferInformation, "string", receiverKyc, senderKyc, "string", "2023-01-12T12:51:19.260+00:00"); } catch (JSONException e) { @@ -281,22 +281,22 @@ public void iCanCreateGSMATransactionDTOWithInvalidAmountFormat() { @Given("I can create GSMATransferDTO with incorrect Payer") public void iCanCreateGSMATransferDTOWithIncorrectPayerHelper() { GSMATransferHelper gsmaTransferHelper = new GSMATransferHelper(); - Fee fee = gsmaTransferHelper.feeHelper("11", "USD", "string"); + Fee fee = gsmaTransferHelper.feeHelper("11", "TZS", "string"); GsmaParty debitParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "449999"); GsmaParty creditParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "835322416"); InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper - .internationalTransferInformationHelper("string", "string", "directtoaccount", "USA", "USA", "USA", "USA"); - IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "USA", "2022-09-28T12:51:19.260+00:00", + .internationalTransferInformationHelper("string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); + IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "Tanzania", "2022-09-28T12:51:19.260+00:00", "2022-09-28T12:51:19.260+00:00", "string", "string"); - PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "USA", "string", + PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "Tanzania", "string", "string"); SubjectName subjectName = gsmaTransferHelper.subjectNameHelper("string", "string", "string", "string", "string"); - Kyc senderKyc = gsmaTransferHelper.kycHelper("USA", "2000-11-20", "string", "string", "string", 'm', idDocument, "USA", "string", + Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", postalAddress, subjectName); - Kyc receiverKyc = gsmaTransferHelper.kycHelper("USA", "2000-11-20", "string", "string", "string", 'm', idDocument, "USA", "string", + Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", postalAddress, subjectName); try { - gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("11", debitParty, creditParty, "USD", "string", "string", + gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("11", debitParty, creditParty, "TZS", "string", "string", "string", "transfer", "string", fee, "37.423825,-122.082900", internationalTransferInformation, "string", receiverKyc, senderKyc, "string", "2023-01-12T12:51:19.260+00:00"); } catch (JSONException e) { @@ -307,22 +307,22 @@ public void iCanCreateGSMATransferDTOWithIncorrectPayerHelper() { @Given("I can create GSMATransferDTO with Payer Insufficient Balance") public void iCanCreateGSMATransferDTOWithPayerInsufficientBalance() { GSMATransferHelper gsmaTransferHelper = new GSMATransferHelper(); - Fee fee = gsmaTransferHelper.feeHelper("110", "USD", "string"); + Fee fee = gsmaTransferHelper.feeHelper("110", "TZS", "string"); GsmaParty debitParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "835322416"); GsmaParty creditParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "398714218"); InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper - .internationalTransferInformationHelper("string", "string", "directtoaccount", "USA", "USA", "USA", "USA"); - IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "USA", "2022-09-28T12:51:19.260+00:00", + .internationalTransferInformationHelper("string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); + IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "Tanzania", "2022-09-28T12:51:19.260+00:00", "2022-09-28T12:51:19.260+00:00", "string", "string"); - PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "USA", "string", + PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "Tanzania", "string", "string"); SubjectName subjectName = gsmaTransferHelper.subjectNameHelper("string", "string", "string", "string", "string"); - Kyc senderKyc = gsmaTransferHelper.kycHelper("USA", "2000-11-20", "string", "string", "string", 'm', idDocument, "USA", "string", + Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", postalAddress, subjectName); - Kyc receiverKyc = gsmaTransferHelper.kycHelper("USA", "2000-11-20", "string", "string", "string", 'm', idDocument, "USA", "string", + Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", postalAddress, subjectName); try { - gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("11000", debitParty, creditParty, "USD", "string", + gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("11000", debitParty, creditParty, "TZS", "string", "string", "string", "transfer", "string", fee, "37.423825,-122.082900", internationalTransferInformation, "string", receiverKyc, senderKyc, "string", "2023-01-12T12:51:19.260+00:00"); } catch (JSONException e) { @@ -333,22 +333,22 @@ public void iCanCreateGSMATransferDTOWithPayerInsufficientBalance() { @Given("I can create GSMATransferDTO with invalid payer information") public void iCanCreateGSMATransferDTOWithInvalidData() { GSMATransferHelper gsmaTransferHelper = new GSMATransferHelper(); - Fee fee = gsmaTransferHelper.feeHelper("11", "USD", "string"); + Fee fee = gsmaTransferHelper.feeHelper("11", "TZS", "string"); GsmaParty debitParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "449999hhhhdsda"); GsmaParty creditParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "835322416ffgg"); InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper - .internationalTransferInformationHelper("string", "string", "directtoaccount", "USA", "USA", "USA", "USA"); - IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "USA", "2022-09-28T12:51:19.260+00:00", + .internationalTransferInformationHelper("string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); + IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "Tanzania", "2022-09-28T12:51:19.260+00:00", "2022-09-28T12:51:19.260+00:00", "string", "string"); - PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "USA", "string", + PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "Tanzania", "string", "string"); SubjectName subjectName = gsmaTransferHelper.subjectNameHelper("string", "string", "string", "string", "string"); - Kyc senderKyc = gsmaTransferHelper.kycHelper("USA", "2000-11-20", "string", "string", "string", 'm', idDocument, "USA", "string", + Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", postalAddress, subjectName); - Kyc receiverKyc = gsmaTransferHelper.kycHelper("USA", "2000-11-20", "string", "string", "string", 'm', idDocument, "USA", "string", + Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", postalAddress, subjectName); try { - gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("11", debitParty, creditParty, "USD", "string", "string", + gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("11", debitParty, creditParty, "TZS", "string", "string", "string", "transfer", "string", fee, "37.423825,-122.082900", internationalTransferInformation, "string", receiverKyc, senderKyc, "string", "2023-01-12T12:51:19.260+00:00"); } catch (JSONException e) { @@ -381,23 +381,23 @@ public void iShouldPollTheTransferQueryEndpointWithTransactionIdUntilStatusIsPop @When("I can create GSMATransferDTO with different payer and payee") public void iCanCreateGSMATransactionDTOWithDifferentPayerAndPayee() { GSMATransferHelper gsmaTransferHelper = new GSMATransferHelper(); - Fee fee = gsmaTransferHelper.feeHelper("11", "USD", "string"); + Fee fee = gsmaTransferHelper.feeHelper("11", "TZS", "string"); GsmaParty debit = gsmaTransferHelper.gsmaPartyHelper("msisdn", scenarioScopeState.debitParty); GsmaParty credit = gsmaTransferHelper.gsmaPartyHelper("msisdn", scenarioScopeState.creditParty); InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper - .internationalTransferInformationHelper("string", "string", "directtoaccount", "USA", "USA", "USA", "USA"); - IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "USA", "2022-09-28T12:51:19.260+00:00", + .internationalTransferInformationHelper("string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); + IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "Tanzania", "2022-09-28T12:51:19.260+00:00", "2022-09-28T12:51:19.260+00:00", "string", "string"); - PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "USA", "string", + PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "Tanzania", "string", "string"); SubjectName subjectName = gsmaTransferHelper.subjectNameHelper("string", "string", "string", "string", "string"); - Kyc senderKyc = gsmaTransferHelper.kycHelper("USA", "2000-11-20", "string", "string", "string", 'm', idDocument, "USA", "string", + Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", postalAddress, subjectName); - Kyc receiverKyc = gsmaTransferHelper.kycHelper("USA", "2000-11-20", "string", "string", "string", 'm', idDocument, "USA", "string", + Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", postalAddress, subjectName); scenarioScopeState.gsmaP2PAmtDebit = 11; try { - ErrorCodeStepDef.gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("11", debit, credit, "USD", "string", + ErrorCodeStepDef.gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("11", debit, credit, "TZS", "string", "string", "string", "transfer", "string", fee, "37.423825,-122.082900", internationalTransferInformation, "string", receiverKyc, senderKyc, "string", "2023-01-12T12:51:19.260+00:00"); } catch (JSONException e) { diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferDef.java index d933124c1..2f10040a3 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferDef.java @@ -113,7 +113,7 @@ protected String setBodyLoanProduct() throws JsonProcessingException { String name = new StringBuilder().append(getAlphaNumericString(4)).append(tenant).toString(); String shortName = getAlphaNumericString(4); PostLoanProductsRequest loanProductsRequest = new PostLoanProductsRequest(); - loanProductsRequest.setCurrencyCode("USD"); + loanProductsRequest.setCurrencyCode("TZS"); loanProductsRequest.setInMultiplesOf(2); loanProductsRequest.setDigitsAfterDecimal(2); loanProductsRequest.setDaysInYearType(1); @@ -211,7 +211,7 @@ protected String setBodySavingsProduct() throws JsonProcessingException { String shortName = getAlphaNumericString(4); PostSavingsProductsRequest savingsProductsRequest = new PostSavingsProductsRequest(); - savingsProductsRequest.setCurrencyCode("USD"); + savingsProductsRequest.setCurrencyCode("TZS"); savingsProductsRequest.setDigitsAfterDecimal(2); savingsProductsRequest.setInterestCompoundingPeriodType(1); savingsProductsRequest.setInterestPostingPeriodType(4); @@ -335,7 +335,7 @@ protected String setGsmaTransactionBody(String prefix) throws JsonProcessingExce String dateFormatGiven = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"; String currentDate = new SimpleDateFormat(dateFormatGiven).format(new Date()); - GsmaTransfer gsmaTransfer = new GsmaTransfer("RKTQDM7W6S", "inbound", "transfer", Integer.toString(amount), "USD", "note", + GsmaTransfer gsmaTransfer = new GsmaTransfer("RKTQDM7W6S", "inbound", "transfer", Integer.toString(amount), "TZS", "note", currentDate, customData, payer, payee); return objectMapper.writeValueAsString(gsmaTransfer); } diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/IdentityMapperStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/IdentityMapperStepDef.java index 954c01c91..d0c9641d6 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/IdentityMapperStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/IdentityMapperStepDef.java @@ -531,13 +531,13 @@ public void iCreateAIdentityMapperDTOForRegisteringBeneficiary() { @And("I create a IdentityMapperDTO for registering payee with IAM") public void iCreateAIdentityMapperDTOForRegisteringPayee() { List beneficiaryDTOList = new ArrayList<>(); - String payeeFsp = "payeefsp3"; - String[] financialAddressArray = { "1234", "1235", "1236" }; + String[] payeeFsps = { "payeefsp1", "payeefsp2", "payeefsp3" }; + String[] payeeIdentifiers = { "400173110196", "400174120160", "400173110195" }; + String[] financialAddressArray = { "1234", "2235", "3235" }; int fspIndex = 0; - Set payeeIdentifiers = new HashSet<>(scenarioScopeState.payeeIdentifiers); for (String payeeIdentifier : payeeIdentifiers) { BeneficiaryDTO beneficiaryDTO = new BeneficiaryDTO(payeeIdentifier, "00", financialAddressArray[fspIndex], - payeeFspConfig.getPayeeFsp(payeeFsp)); + payeeFspConfig.getPayeeFsp(payeeFsps[fspIndex])); beneficiaryDTOList.add(beneficiaryDTO); fspIndex++; } diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopDef.java index cbb0ede07..53b15cdaa 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopDef.java @@ -42,7 +42,7 @@ public class MojaloopDef { Logger logger = LoggerFactory.getLogger(this.getClass()); - private static final String CURRENCY = "USD"; + private static final String CURRENCY = "TZS"; protected String setBodyAddAlsUser(String fspId) throws JsonProcessingException { AddUserAlsRequest addUserAlsRequest = new AddUserAlsRequest(); @@ -116,7 +116,7 @@ protected void createSettlementModelDeferredNetUSD() { RequestSpecification requestSpec = Utils.getDefaultSpec(); requestSpec.header("Content-Type", "application/json"); String endpoint = mojaloopConfig.settlementModel; - SettlementModelRequestBody requestBody = settlementModelRequestBody("DEFERREDNETUSD"); + SettlementModelRequestBody requestBody = settlementModelRequestBody("DEFERREDNETTZS"); requestBody.setCurrency(CURRENCY); Response response = RestAssured.given(requestSpec).baseUri(mojaloopConfig.mojaloopCentralLedgerBaseurl).body(requestBody).when() @@ -215,7 +215,7 @@ protected void recordFunds(String fsp) throws JsonProcessingException { RequestSpecification requestSpec = Utils.getDefaultSpec(); requestSpec.header("Content-Type", "application/json"); String endpoint = mojaloopConfig.recordFundsEndpoint.replaceAll("\\{\\{fsp\\}\\}", fsp) - .replaceAll("\\{\\{payerfspSettlementAccountId\\}\\}", "4"); + .replaceAll("\\{\\{payerfspSettlementAccountId\\}\\}", "16"); String requestBody = objectMapper.writeValueAsString(getRecordFundsRequestBody()); Response responseBody = RestAssured.given(requestSpec).baseUri(mojaloopConfig.mojaloopCentralLedgerBaseurl).body(requestBody) diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferDef.java index 4bdc7621b..ee8a71f11 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferDef.java @@ -127,7 +127,7 @@ protected String setBodySavingsProduct() throws JsonProcessingException { String shortName = getAlphaNumericString(4); PostSavingsProductsRequest savingsProductsRequest = new PostSavingsProductsRequest(); - savingsProductsRequest.setCurrencyCode("USD"); + savingsProductsRequest.setCurrencyCode("TZS"); savingsProductsRequest.setDigitsAfterDecimal(2); savingsProductsRequest.setInterestCompoundingPeriodType(1); savingsProductsRequest.setInterestPostingPeriodType(4); @@ -151,7 +151,7 @@ protected String setBodySavingsApprove() throws JsonProcessingException { return objectMapper.writeValueAsString(savingsApprove); } - protected String setBodySavingsAccount(String client) throws JsonProcessingException { + protected String setBodySavingsAccount(String client, String interopId) throws JsonProcessingException { // Getting resourceId and clientId PostClientsResponse createPayerClientResponse; @@ -165,7 +165,7 @@ protected String setBodySavingsAccount(String client) throws JsonProcessingExcep PostSavingsProductsResponse.class); String date = getCurrentDate(); setcurrentDate(date); - externalId = UUID.randomUUID().toString(); + externalId = interopId; PostSavingsAccountsRequest savingsAccountsRequest = new PostSavingsAccountsRequest(); savingsAccountsRequest.setClientId(createPayerClientResponse.getClientId()); savingsAccountsRequest.setProductId(savingsProductResponse.getResourceId()); @@ -208,13 +208,13 @@ protected String setSavingsDepositAccount(int amount) throws JsonProcessingExcep return objectMapper.writeValueAsString(savingsAccountDeposit); } - protected String setBodyPayerClient() throws JsonProcessingException { + protected String setBodyPayerClient(String firstName, String lastName) throws JsonProcessingException { String date = getCurrentDate(); PostClientsRequest postClientsRequest = new PostClientsRequest(); postClientsRequest.setOfficeId(1); postClientsRequest.setLegalFormId(1); - postClientsRequest.setFirstname("John"); - postClientsRequest.setLastname("Wick"); + postClientsRequest.setFirstname(firstName); + postClientsRequest.setLastname(lastName); postClientsRequest.setActive(true); postClientsRequest.setLocale("en"); postClientsRequest.setDateFormat("dd MMMM yyyy"); @@ -223,13 +223,13 @@ protected String setBodyPayerClient() throws JsonProcessingException { return objectMapper.writeValueAsString(postClientsRequest); } - protected String setBodyPayeeClient() throws JsonProcessingException { + protected String setBodyPayeeClient(String firstName, String lastName) throws JsonProcessingException { String date = getCurrentDate(); PostClientsRequest postClientsRequest = new PostClientsRequest(); postClientsRequest.setOfficeId(1); postClientsRequest.setLegalFormId(1); - postClientsRequest.setFirstname("John"); - postClientsRequest.setLastname("Wick"); + postClientsRequest.setFirstname(firstName); + postClientsRequest.setLastname(lastName); postClientsRequest.setActive(true); postClientsRequest.setLocale("en"); postClientsRequest.setDateFormat("dd MMMM yyyy"); @@ -238,11 +238,11 @@ protected String setBodyPayeeClient() throws JsonProcessingException { return objectMapper.writeValueAsString(postClientsRequest); } - protected String setBodyClient(String client) throws JsonProcessingException { + protected String setBodyClient(String client, String firstName, String lastName) throws JsonProcessingException { if (client.equals("payer")) { - return setBodyPayerClient(); + return setBodyPayerClient(firstName, lastName); } else if (client.equals("payee")) { - return setBodyPayeeClient(); + return setBodyPayeeClient(firstName, lastName); } return client; } @@ -254,7 +254,7 @@ protected String setBodyPayeeQuoteRequest(String payerIdentifier, String payeeId requestDTO.setPayer(getParty(payerIdentifier, mojaloopConfig.payerFspId)); requestDTO.setPayee(getParty(payeeIdentifier, mojaloopConfig.payeeFspId)); requestDTO.setAmountType(AmountType.RECEIVE); - requestDTO.setAmount(new MoneyData(amount, "USD")); + requestDTO.setAmount(new MoneyData(amount, "TZS")); requestDTO.setTransactionId(UUID.randomUUID().toString()); requestDTO.setQuoteId(quoteId); TransactionType transactionType = new TransactionType(); @@ -277,7 +277,7 @@ protected String setBodyPayeeTransferRequest(String amount, String ilpPacket, St requestDTO.setTransferId(UUID.randomUUID().toString()); requestDTO.setPayeeFsp(mojaloopConfig.payerFspId); requestDTO.setPayeeFsp(mojaloopConfig.payeeFspId); - requestDTO.setAmount(new MoneyData(amount, "USD")); + requestDTO.setAmount(new MoneyData(amount, "TZS")); requestDTO.setIlpPacket(ilpPacket); requestDTO.setCondition(condition); return objectMapper.writeValueAsString(requestDTO); diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java index 373b8f6d2..55c1458e0 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java @@ -93,14 +93,17 @@ public void setTenantForPayer(String client) { logger.info(tenant); } - @When("I call the create client endpoint for {string}") - public void callCreateClientEndpoint(String client) throws JsonProcessingException { + @When("I call the create client endpoint for {string} with account holder name as {string} {string}") + public void callCreateClientEndpoint(String client, String firstName, String lastName) throws JsonProcessingException { RequestSpecification requestSpec = Utils.getDefaultSpec(); requestSpec = fundTransferDef.setHeaders(requestSpec); - logger.info(client); - - fundTransferDef.createClientBody = fundTransferDef.setBodyClient(client); + if(firstName == null) + { + firstName = "Claudia"; + lastName = "Cardinale"; + } + fundTransferDef.createClientBody = fundTransferDef.setBodyClient(client, firstName, lastName); // Calling savings product endpoint String clientResponse = RestAssured.given(requestSpec).baseUri(transferConfig.clientBaseUrl).body(fundTransferDef.createClientBody) .expect().spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when().post(transferConfig.clientEndpoint) @@ -131,12 +134,14 @@ public void callCreateSavingsProductEndpoint(String client) throws JsonProcessin assertThat(fundTransferDef.responseSavingsProduct).isNotEmpty(); } - @When("I call the create savings account endpoint for {string}") - public void callCreateSavingsAccountEndpoint(String client) throws JsonProcessingException { + @When("I call the create savings account endpoint for {string} with accountId {string}") + public void callCreateSavingsAccountEndpoint(String client, String interopId) throws JsonProcessingException { // Setting headers and body RequestSpecification requestSpec = Utils.getDefaultSpec(); requestSpec = fundTransferDef.setHeaders(requestSpec); - fundTransferDef.savingsAccountBody = fundTransferDef.setBodySavingsAccount(client); + interopId = UUID.randomUUID().toString(); + + fundTransferDef.savingsAccountBody = fundTransferDef.setBodySavingsAccount(client, interopId); // Calling savings product endpoint String responseSavingsAccount = RestAssured.given(requestSpec).baseUri(transferConfig.savingsBaseUrl) .body(fundTransferDef.savingsAccountBody).expect().spec(new ResponseSpecBuilder().expectStatusCode(200).build()).when() @@ -586,9 +591,9 @@ public void getCurrentBalance(String client, Long amount) throws JsonProcessingE @When("I create and setup a {string} with account balance of {int}") public void consolidatedPayerCreationSteps(String client, int amount) throws JsonProcessingException { setTenantForPayer(client); - callCreateClientEndpoint(client); + callCreateClientEndpoint(client, null, null); callCreateSavingsProductEndpoint(client); - callCreateSavingsAccountEndpoint(client); + callCreateSavingsAccountEndpoint(client, null); callCreateInteropIdentifierEndpoint(client); callApproveSavingsEndpoint("approve", client); callSavingsActivateEndpoint("activate", client); @@ -615,7 +620,7 @@ public void createCsvWithHeaders(String fileName) throws IOException { public void addRowToCsvFile(String paymentMode, int transferAmount, int id) throws IOException { String[] row = { String.valueOf(id), UUID.randomUUID().toString(), paymentMode, "msisdn", scenarioScopeState.payerIdentifier, - "msisdn", scenarioScopeState.payeeIdentifier, String.valueOf(transferAmount), "USD", "Test Payee Payment" }; + "msisdn", scenarioScopeState.payeeIdentifier, String.valueOf(transferAmount), "TZS", "Test Payee Payment" }; String filePath = Utils.getAbsoluteFilePathToResource(scenarioScopeState.filename); csvHelper.addRow(filePath, row); scenarioScopeState.gsmaP2PAmtDebit = scenarioScopeState.gsmaP2PAmtDebit + transferAmount; @@ -632,7 +637,7 @@ public void addRowToCsvFileForCombinedTestCases(String paymentMode, int transfer } String[] row = { String.valueOf(id), UUID.randomUUID().toString(), paymentMode, "msisdn", scenarioScopeState.payerIdentifier, - "msisdn", scenarioScopeState.payeeIdentifier, String.valueOf(transferAmount), "USD", "Test Payee Payment" }; + "msisdn", scenarioScopeState.payeeIdentifier, String.valueOf(transferAmount), "TZS", "Test Payee Payment" }; String filePath = Utils.getAbsoluteFilePathToResource(scenarioScopeState.filename); csvHelper.addRow(filePath, row); scenarioScopeState.gsmaP2PAmtDebit = scenarioScopeState.gsmaP2PAmtDebit + transferAmount; @@ -646,9 +651,9 @@ public void addRowToCsvFileForCombinedTestCases(String paymentMode, int transfer public void consolidatedPayeeCreationStepsForAllCombinedTestsCases(String client, String id, int amount) throws JsonProcessingException { setTenantForPayer(client); - callCreateClientEndpoint(client); + callCreateClientEndpoint(client, null, null); callCreateSavingsProductEndpoint(client); - callCreateSavingsAccountEndpoint(client); + callCreateSavingsAccountEndpoint(client, null); callCreateInteropIdentifierEndpoint(client); callApproveSavingsEndpoint("approve", client); callSavingsActivateEndpoint("activate", client); @@ -673,7 +678,7 @@ public void consolidatedPayeeCreationStepsForAllCombinedTestsCases(String client public void addRowToCsvFileForAllCombinedTestCases(String paymentMode, int transferAmount, int id) throws IOException { String[] row = { String.valueOf(id), UUID.randomUUID().toString(), paymentMode, "msisdn", scenarioScopeState.payerIdentifier, - "msisdn", scenarioScopeState.payeeIdentifier, String.valueOf(transferAmount), "USD", "Test Payee Payment" }; + "msisdn", scenarioScopeState.payeeIdentifier, String.valueOf(transferAmount), "TZS", "Test Payee Payment" }; String filePath = Utils.getAbsoluteFilePathToResource(scenarioScopeState.filename); csvHelper.addRow(filePath, row); scenarioScopeState.gsmaP2PAmtDebit = scenarioScopeState.gsmaP2PAmtDebit + transferAmount; @@ -687,7 +692,7 @@ public void addRowToCsvFileForAllCombinedTestCases(String paymentMode, int trans public void addLastRowToCsvFile(String paymentMode, int transferAmount, int id) throws IOException { String[] row = { String.valueOf(id), UUID.randomUUID().toString(), paymentMode, "msisdn", scenarioScopeState.payerIdentifier, - "msisdn", scenarioScopeState.payeeIdentifier, String.valueOf(transferAmount), "USD", "Test Payee Payment" }; + "msisdn", scenarioScopeState.payeeIdentifier, String.valueOf(transferAmount), "TZS", "Test Payee Payment" }; String filePath = Utils.getAbsoluteFilePathToResource(scenarioScopeState.filename); csvHelper.addLastRow(filePath, row); scenarioScopeState.gsmaP2PAmtDebit = scenarioScopeState.gsmaP2PAmtDebit + transferAmount; @@ -698,9 +703,9 @@ public void addLastRowToCsvFile(String paymentMode, int transferAmount, int id) @When("I create and setup a {string} with id {string} and account balance of {int}") public void consolidatedPayeeCreationSteps(String client, String id, int amount) throws JsonProcessingException { setTenantForPayer(client); - callCreateClientEndpoint(client); + callCreateClientEndpoint(client, null, null); callCreateSavingsProductEndpoint(client); - callCreateSavingsAccountEndpoint(client); + callCreateSavingsAccountEndpoint(client, null); callCreateInteropIdentifierEndpoint(client); callApproveSavingsEndpoint("approve", client); callSavingsActivateEndpoint("activate", client); @@ -724,9 +729,9 @@ public void consolidatedPayeeCreationSteps(String client, String id, int amount) @When("I create and setup a {string} with id {string} and account balance of {int} for combine test cases") public void consolidatedPayeeCreationStepsForCombinedTestsCases(String client, String id, int amount) throws JsonProcessingException { setTenantForPayer(client); - callCreateClientEndpoint(client); + callCreateClientEndpoint(client, null, null); callCreateSavingsProductEndpoint(client); - callCreateSavingsAccountEndpoint(client); + callCreateSavingsAccountEndpoint(client, null); callCreateInteropIdentifierEndpoint(client); callApproveSavingsEndpoint("approve", client); callSavingsActivateEndpoint("activate", client); @@ -769,4 +774,26 @@ public void budgetAccountExistsWithAccoundId(String accountId) throws JsonProces assertThat(fundTransferDef.responseInteropIdentifier).isNotEmpty(); } + @Then("add row to csv with current ministry and payee {string}, payment mode as {string} and transfer amount {int} and id {int}") + public void addRowToCsvWithCurrentMinistryAndPayeePaymentModeAsAndTransferAmountAndId(String payee_identifier, String paymentMode, int transferAmount, int id) throws IOException { + String[] row = { String.valueOf(id), UUID.randomUUID().toString(), paymentMode, "msisdn", "N/A", + "msisdn", payee_identifier, String.valueOf(transferAmount), "TZS", "Test Payee Payment" }; + String filePath = Utils.getAbsoluteFilePathToResource(scenarioScopeState.filename); + scenarioScopeState.batchDebitAmt = scenarioScopeState.batchDebitAmt + transferAmount; + if (scenarioScopeState.bulkTransactionList == null) { + scenarioScopeState.bulkTransactionList = new int[9]; + } + scenarioScopeState.bulkTransactionList[id + 1] = transferAmount; + csvHelper.addRow(filePath, row); + } + + @Then("add last row to csv with current ministry and payee {string}, payment mode as {string} and transfer amount {int} and id {int}") + public void addLastRowToCsvWithCurrentMinistryAndPayeePaymentModeAsAndTransferAmountAndId(String payee_identifier, String paymentMode, int transferAmount, int id) throws IOException { + String[] row = { String.valueOf(id), UUID.randomUUID().toString(), paymentMode, "msisdn", "N/A", + "msisdn", payee_identifier, String.valueOf(transferAmount), "TZS", "Test Payee Payment" }; + String filePath = Utils.getAbsoluteFilePathToResource(scenarioScopeState.filename); + csvHelper.addLastRow(filePath, row); + scenarioScopeState.batchDebitAmt = scenarioScopeState.batchDebitAmt + transferAmount; + scenarioScopeState.bulkTransactionList[id + 1] = transferAmount; + } } diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/ScenarioScopeState.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/ScenarioScopeState.java index a0dde5444..7317c9443 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/ScenarioScopeState.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/ScenarioScopeState.java @@ -103,6 +103,8 @@ public class ScenarioScopeState { protected int[] initialBalForPayeeForBatch; protected int[] initialBalForPayerForBatch; protected int[] gsmaP2PAmtDebitForBatch; + protected int[] bulkTransactionList; + protected int batchDebitAmt; protected List registeredBeneficiary = new ArrayList<>(); protected String serialNumber; diff --git a/src/test/java/resources/batch.feature b/src/test/java/resources/batch.feature index 702a5f355..2007e8930 100644 --- a/src/test/java/resources/batch.feature +++ b/src/test/java/resources/batch.feature @@ -269,7 +269,7 @@ Feature: Batch Details API test Given I will start the mock server And I can register the stub with "/authorization/callback" endpoint for "POST" request with status of 200 Then I will update the mock server and register stub as done - When I create an AuthorizationRequest for Batch Authorization with batch ID as "1234", payerIdentifier as "5678", currency as "USD" and amount as "30" + When I create an AuthorizationRequest for Batch Authorization with batch ID as "1234", payerIdentifier as "5678", currency as "TZS" and amount as "30" And I call the Authorization API with batchId as "1234" and expected status of 202 and stub "/authorization/callback" # And I will sleep for 5000 millisecond Then I should be able to verify that the "POST" method to "/authorization/callback" endpoint received a request with authorization status diff --git a/src/test/java/resources/batch_demo_csv/batchTransactioClosedLoopMojaloopFundTransfer.csv b/src/test/java/resources/batch_demo_csv/batchTransactioClosedLoopMojaloopFundTransfer.csv index 186f4b564..7a18c876b 100644 --- a/src/test/java/resources/batch_demo_csv/batchTransactioClosedLoopMojaloopFundTransfer.csv +++ b/src/test/java/resources/batch_demo_csv/batchTransactioClosedLoopMojaloopFundTransfer.csv @@ -1,9 +1,9 @@ id,request_id,payment_mode,payer_identifier_type,payer_identifier,payee_identifier_type,payee_identifier,amount,currency,note -0,dbe1d284-1bea-4f03-bc0f-8faece9f5da2,closedloop,msisdn,2300,msisdn,1759,10,USD,Test Payee Payment -1,696a9340-adc2-48e3-a1d1-10a239bc412b,closedloop,msisdn,2301,msisdn,1760,5,USD,Test Payee Payment -2,8e2eaf78-4566-438e-9183-ec02288fd16b,closedloop,msisdn,2302,msisdn,1761,5,USD,Test Payee Payment -3,b9bc0bc8-cf25-417a-adbc-97345330737a,closedloop,msisdn,2303,msisdn,1762,5,USD,Test Payee Payment -4,a59acbe1-4ebb-4618-bda3-630f2c306e09,closedloop,msisdn,2304,msisdn,1763,5,USD,Test Payee Payment -5,d79a4bc6-f9ec-4eba-beb7-96277bd832b3,mojaloop,msisdn,2305,msisdn,1764,3,USD,Test Payee Payment -6,1f838585-5091-44ef-9432-77d13b9c4583,mojaloop,msisdn,2306,msisdn,1764,2,USD,Test Payee Payment -7,94fd7bd1-7482-4f4f-bf12-a21ab4b550a8,mojaloop,msisdn,2307,msisdn,1765,1,USD,Test Payee Payment \ No newline at end of file +0,dbe1d284-1bea-4f03-bc0f-8faece9f5da2,closedloop,msisdn,2300,msisdn,1759,10,TZS,Test Payee Payment +1,696a9340-adc2-48e3-a1d1-10a239bc412b,closedloop,msisdn,2301,msisdn,1760,5,TZS,Test Payee Payment +2,8e2eaf78-4566-438e-9183-ec02288fd16b,closedloop,msisdn,2302,msisdn,1761,5,TZS,Test Payee Payment +3,b9bc0bc8-cf25-417a-adbc-97345330737a,closedloop,msisdn,2303,msisdn,1762,5,TZS,Test Payee Payment +4,a59acbe1-4ebb-4618-bda3-630f2c306e09,closedloop,msisdn,2304,msisdn,1763,5,TZS,Test Payee Payment +5,d79a4bc6-f9ec-4eba-beb7-96277bd832b3,mojaloop,msisdn,2305,msisdn,1764,3,TZS,Test Payee Payment +6,1f838585-5091-44ef-9432-77d13b9c4583,mojaloop,msisdn,2306,msisdn,1764,2,TZS,Test Payee Payment +7,94fd7bd1-7482-4f4f-bf12-a21ab4b550a8,mojaloop,msisdn,2307,msisdn,1765,1,TZS,Test Payee Payment diff --git a/src/test/java/resources/batch_demo_csv/batchTransaction.csv b/src/test/java/resources/batch_demo_csv/batchTransaction.csv index 18905bd4d..78309bd05 100644 --- a/src/test/java/resources/batch_demo_csv/batchTransaction.csv +++ b/src/test/java/resources/batch_demo_csv/batchTransaction.csv @@ -1,4 +1,4 @@ id,request_id,payment_mode,payer_identifier_type,payer_identifier,payee_identifier_type,payee_identifier,amount,currency,note -0,ed6bf87e-4bda-44dc-be52-004e71438f0f,mojaloop,msisdn,345,msisdn,363,3,USD,Test Payee Payment -1,25ddc445-069a-417b-b62a-f5b952ac313e,mojaloop,msisdn,346,msisdn,363,2,USD,Test Payee Payment -2,0842d2df-0aec-4312-ada4-c3dd2be1ed80,mojaloop,msisdn,347,msisdn,364,1,USD,Test Payee Payment \ No newline at end of file +0,ed6bf87e-4bda-44dc-be52-004e71438f0f,mojaloop,msisdn,345,msisdn,363,3,TZS,Test Payee Payment +1,25ddc445-069a-417b-b62a-f5b952ac313e,mojaloop,msisdn,346,msisdn,363,2,TZS,Test Payee Payment +2,0842d2df-0aec-4312-ada4-c3dd2be1ed80,mojaloop,msisdn,347,msisdn,364,1,TZS,Test Payee Payment diff --git a/src/test/java/resources/batch_demo_csv/batchTransactionGsma.csv b/src/test/java/resources/batch_demo_csv/batchTransactionGsma.csv index e8e8fcd26..23a8ad31f 100644 --- a/src/test/java/resources/batch_demo_csv/batchTransactionGsma.csv +++ b/src/test/java/resources/batch_demo_csv/batchTransactionGsma.csv @@ -1,4 +1,4 @@ id,request_id,payment_mode,payer_identifier_type,payer_identifier,payee_identifier_type,payee_identifier,amount,currency,note -0,1fe8af66-9a34-4b92-bbd5-1a116b635bb5,gsma,msisdn,4004,msisdn,3815,10,USD,Test Payee Payment -1,dbbe52aa-20a0-4eb9-80a0-ad6df8068e40,gsma,msisdn,4005,msisdn,3816,5,USD,Test Payee Payment -2,021955bc-8a96-45d3-bec0-69e365d5369c,gsma,msisdn,4006,msisdn,3817,1,USD,Test Payee Payment \ No newline at end of file +0,1fe8af66-9a34-4b92-bbd5-1a116b635bb5,gsma,msisdn,4004,msisdn,3815,10,TZS,Test Payee Payment +1,dbbe52aa-20a0-4eb9-80a0-ad6df8068e40,gsma,msisdn,4005,msisdn,3816,5,TZS,Test Payee Payment +2,021955bc-8a96-45d3-bec0-69e365d5369c,gsma,msisdn,4006,msisdn,3817,1,TZS,Test Payee Payment diff --git a/src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoop.csv b/src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoop.csv new file mode 100644 index 000000000..ad1b9b78f --- /dev/null +++ b/src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoop.csv @@ -0,0 +1,9 @@ +id,request_id,payment_mode,payer_identifier_type,payer_identifier,payee_identifier_type,payee_identifier,amount,currency,note +0,25a92f3d-c4e6-4332-876b-3fc2f09ef272,closedloop,msisdn,3508,msisdn,2662,10,TZS,Test Payee Payment +1,fde43673-b28e-466a-80d2-4afbf13f2e58,closedloop,msisdn,3509,msisdn,2663,5,TZS,Test Payee Payment +2,57f478a0-b302-4c11-b92a-5079505dacba,closedloop,msisdn,3510,msisdn,2664,5,TZS,Test Payee Payment +3,ea15d689-432d-4a83-af20-5e1e749226a2,closedloop,msisdn,3511,msisdn,2665,5,TZS,Test Payee Payment +4,2957cd32-2818-4236-b41b-bd731c192e89,closedloop,msisdn,3512,msisdn,2666,5,TZS,Test Payee Payment +5,77335aec-69eb-4535-b7ca-ac71de2eed23,gsma,msisdn,3513,msisdn,2667,6,TZS,Test Payee Payment +6,96184a44-0b27-496c-9e73-ce4511ab4dc4,gsma,msisdn,3514,msisdn,2668,7,TZS,Test Payee Payment +7,69b31b9d-926b-4613-aa23-e96fad7fbf90,gsma,msisdn,3515,msisdn,2669,8,TZS,Test Payee Payment \ No newline at end of file diff --git a/src/test/java/resources/batch_demo_csv/bulk_payment.csv b/src/test/java/resources/batch_demo_csv/bulk_payment.csv index 31c9cee76..832bb028e 100644 --- a/src/test/java/resources/batch_demo_csv/bulk_payment.csv +++ b/src/test/java/resources/batch_demo_csv/bulk_payment.csv @@ -1,7 +1,7 @@ id,request_id,payment_mode,payer_identifier_type,payer_identifier,payee_identifier_type,payee_identifier,amount,currency,note -0,g1e22fe3-9740-4fba-97b6-78f43bfa7f2f,closedloop,accountNumber,003001003879112168,accountNumber,400173110196,850,USD,Test Payee Payment -1,72aa3ea4-e6f6-4880-877f-39f6ac4d052e,closedloop,accountNumber,003001003879112168,accountNumber,400174120160,222,USD,Test Payee Payment -2,f1e22fe3-9740-4fba-97b6-78f43bfa7f0f,closedloop,accountNumber,003001003879112168,accountNumber,400173110195,840,USD,Test Payee Payment -3,q1e22fe3-9740-4fba-97b6-78f43bfa7f2f,closedloop,accountNumber,003001003879112168,accountNumber,400173110196,750,USD,Test Payee Payment -4,a2aa3ea4-e6f6-4880-877f-39f6ac4d052e,closedloop,accountNumber,003001003879112168,accountNumber,400174120160,122,USD,Test Payee Payment -5,z1e22fe3-9740-4fba-97b6-78f43bfa7f0f,closedloop,accountNumber,003001003879112168,accountNumber,400173110195,740,USD,Test Payee Payment \ No newline at end of file +0,9b7d4130-1fbb-4ac9-819b-44c0224c0784,closedloop,msisdn,N/A,msisdn,400173110196,100,TZS,Test Payee Payment +1,7348da1e-0576-424f-b41b-9bd01ba26fe7,closedloop,msisdn,N/A,msisdn,400173110196,200,TZS,Test Payee Payment +2,3d16c00d-8b06-4876-af94-717487eecd88,closedloop,msisdn,N/A,msisdn,400174120160,300,TZS,Test Payee Payment +3,de45e6f9-6d19-488d-b5aa-e97099ea0a31,closedloop,msisdn,N/A,msisdn,400174120160,400,TZS,Test Payee Payment +4,7c3f66f2-35c1-41bf-8cc5-5a2807486fc4,closedloop,msisdn,N/A,msisdn,400173110195,700,TZS,Test Payee Payment +5,1b34dcee-a319-422b-9564-a890fa520fd3,closedloop,msisdn,N/A,msisdn,400173110195,800,TZS,Test Payee Payment \ No newline at end of file diff --git a/src/test/java/resources/batch_demo_csv/bulk_payment_closedl_mock_mojaloop.csv b/src/test/java/resources/batch_demo_csv/bulk_payment_closedl_mock_mojaloop.csv index fd9923ee8..b38c30813 100644 --- a/src/test/java/resources/batch_demo_csv/bulk_payment_closedl_mock_mojaloop.csv +++ b/src/test/java/resources/batch_demo_csv/bulk_payment_closedl_mock_mojaloop.csv @@ -1,9 +1,9 @@ id,request_id,payment_mode,payer_identifier_type,payer_identifier,payee_identifier_type,payee_identifier,amount,currency,note -0,g2e22fe3-9740-4fba-97b6-78f43bfa7f2f,closedloop,accountNumber,003001003879112168,accountNumber,400173110196,150,USD,Test Payee Payment -1,71aa3ea4-e6f6-4880-877f-39f6ac4d052e,closedloop,accountNumber,003001003879112168,accountNumber,400174120160,222,USD,Test Payee Payment -2,f4e22fe3-9740-4fba-97b6-78f43bfa7f0f,closedloop,accountNumber,003001003879112168,accountNumber,400173110195,140,USD,Test Payee Payment -3,72aa3ea4-e6f6-4880-877f-39f6ac4d052e,closedloop,accountNumber,003001003879112168,accountNumber,400174120160,220,USD,Test Payee Payment -4,77za3ea4-e6f6-4880-877f-39f6ac4d052e,closedloop,accountNumber,003001003879112168,accountNumber,400174120160,122,USD,Test Payee Payment -5,q0e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,400173110196,750,USD,Test Payee Payment -6,a4aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,003001003879112168,accountNumber,400174120160,722,USD,Test Payee Payment -7,z4e22fe3-9740-4fba-97b6-78f43bfa7f0f,mojaloop,accountNumber,003001003879112168,accountNumber,400173110195,740,USD,Test Payee Payment \ No newline at end of file +0,g2e22fe3-9740-4fba-97b6-78f43bfa7f2f,closedloop,accountNumber,003001003879112168,accountNumber,400173110196,150,TZS,Test Payee Payment +1,71aa3ea4-e6f6-4880-877f-39f6ac4d052e,closedloop,accountNumber,003001003879112168,accountNumber,400174120160,222,TZS,Test Payee Payment +2,f4e22fe3-9740-4fba-97b6-78f43bfa7f0f,closedloop,accountNumber,003001003879112168,accountNumber,400173110195,140,TZS,Test Payee Payment +3,72aa3ea4-e6f6-4880-877f-39f6ac4d052e,closedloop,accountNumber,003001003879112168,accountNumber,400174120160,220,TZS,Test Payee Payment +4,77za3ea4-e6f6-4880-877f-39f6ac4d052e,closedloop,accountNumber,003001003879112168,accountNumber,400174120160,122,TZS,Test Payee Payment +5,q0e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,400173110196,750,TZS,Test Payee Payment +6,a4aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,003001003879112168,accountNumber,400174120160,722,TZS,Test Payee Payment +7,z4e22fe3-9740-4fba-97b6-78f43bfa7f0f,mojaloop,accountNumber,003001003879112168,accountNumber,400173110195,740,TZS,Test Payee Payment diff --git a/src/test/java/resources/batch_demo_csv/deduplication-test.csv b/src/test/java/resources/batch_demo_csv/deduplication-test.csv index 6a855cff8..0cc948894 100644 --- a/src/test/java/resources/batch_demo_csv/deduplication-test.csv +++ b/src/test/java/resources/batch_demo_csv/deduplication-test.csv @@ -1,4 +1,4 @@ id,request_id,payment_mode,payer_identifier_type,payer_identifier,payee_identifier_type,payee_identifier,amount,currency,note -0,k1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,msisdn,835322416,msisdn,27713803912,10,USD,Moja bulk test -1,l9f6ac4d052e-72aa3ea4-e6f6-4880-877f,mojaloop,msisdn,835322416,msisdn,27713803912,10,USD,Moja bulk test -2,m27631f6-6dd4-4d69-b4fc-8932bd721913,mojaloop,msisdn,835322416,msisdn,27713803913,10,USD,Moja bulk test \ No newline at end of file +0,k1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,msisdn,835322416,msisdn,27713803912,10,TZS,Moja bulk test +1,l9f6ac4d052e-72aa3ea4-e6f6-4880-877f,mojaloop,msisdn,835322416,msisdn,27713803912,10,TZS,Moja bulk test +2,m27631f6-6dd4-4d69-b4fc-8932bd721913,mojaloop,msisdn,835322416,msisdn,27713803913,10,TZS,Moja bulk test diff --git a/src/test/java/resources/batch_demo_csv/payerIdentifier-resolution-using-budgetAccount.csv b/src/test/java/resources/batch_demo_csv/payerIdentifier-resolution-using-budgetAccount.csv index 879d73de3..887afb106 100644 --- a/src/test/java/resources/batch_demo_csv/payerIdentifier-resolution-using-budgetAccount.csv +++ b/src/test/java/resources/batch_demo_csv/payerIdentifier-resolution-using-budgetAccount.csv @@ -1,11 +1,11 @@ id,request_id,payment_mode,payer_identifier_type,payer_identifier,payee_identifier_type,payee_identifier,amount,currency,note -0,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,,,msisdn,27713803912,10,USD,Moja bulk test 1 -1,39f6ac4d052e-72aa3ea4-e6f6-4880-877f,mojaloop,,,msisdn,27713803913,20,USD,Moja bulk test 2 -2,a27631f6-6dd4-4d69-b4fc-8932bd721913,mojaloop,,,msisdn,27713803914,30,USD,Moja bulk test 3 -3,3d21e6ea-c583-44ed-b94f-af909fa7616e,mojaloop,,,msisdn,27713803915,40,USD,Moja bulk test 4 -4,15f9a0b0-2299-436d-8433-da564140ba66,mojaloop,,,msisdn,27713803916,50,USD,Moja bulk test 5 -5,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,,,msisdn,27713803917,60,USD,Moja bulk test 1 -6,39f6ac4d052e-72aa3ea4-e6f6-4880-877f,mojaloop,,,msisdn,27713803918,70,USD,Moja bulk test 2 -7,a27631f6-6dd4-4d69-b4fc-8932bd721913,mojaloop,,,msisdn,27713803919,80,USD,Moja bulk test 3 -8,3d21e6ea-c583-44ed-b94f-af909fa7616e,mojaloop,,,msisdn,27713803910,90,USD,Moja bulk test 4 -9,15f9a0b0-2299-436d-8433-da564140ba66,mojaloop,,,msisdn,27713803911,100,USD,Moja bulk test 5 \ No newline at end of file +0,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,,,msisdn,27713803912,10,TZS,Moja bulk test 1 +1,39f6ac4d052e-72aa3ea4-e6f6-4880-877f,mojaloop,,,msisdn,27713803913,20,TZS,Moja bulk test 2 +2,a27631f6-6dd4-4d69-b4fc-8932bd721913,mojaloop,,,msisdn,27713803914,30,TZS,Moja bulk test 3 +3,3d21e6ea-c583-44ed-b94f-af909fa7616e,mojaloop,,,msisdn,27713803915,40,TZS,Moja bulk test 4 +4,15f9a0b0-2299-436d-8433-da564140ba66,mojaloop,,,msisdn,27713803916,50,TZS,Moja bulk test 5 +5,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,,,msisdn,27713803917,60,TZS,Moja bulk test 1 +6,39f6ac4d052e-72aa3ea4-e6f6-4880-877f,mojaloop,,,msisdn,27713803918,70,TZS,Moja bulk test 2 +7,a27631f6-6dd4-4d69-b4fc-8932bd721913,mojaloop,,,msisdn,27713803919,80,TZS,Moja bulk test 3 +8,3d21e6ea-c583-44ed-b94f-af909fa7616e,mojaloop,,,msisdn,27713803910,90,TZS,Moja bulk test 4 +9,15f9a0b0-2299-436d-8433-da564140ba66,mojaloop,,,msisdn,27713803911,100,TZS,Moja bulk test 5 diff --git a/src/test/java/resources/batch_demo_csv/ph-ee-bulk-demo-6.csv b/src/test/java/resources/batch_demo_csv/ph-ee-bulk-demo-6.csv index 9e7158ee3..990eb0d09 100644 --- a/src/test/java/resources/batch_demo_csv/ph-ee-bulk-demo-6.csv +++ b/src/test/java/resources/batch_demo_csv/ph-ee-bulk-demo-6.csv @@ -1,11 +1,11 @@ id,request_id,payment_mode,payer_identifier_type,payer_identifier,payee_identifier_type,payee_identifier,amount,currency,note -0,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,0030010038791121681,accountNumber,0030010038731101961,850,USD,Test Payee Payment -1,72aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,0030010038791121682,accountNumber,0030010038741201602,222,USD,Test Payee Payment -2,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,0030010038791121683,accountNumber,0030010038731101963,850,USD,Test Payee Payment -3,72aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,0030010038791121684,accountNumber,0030010038741201604,222,USD,Test Payee Payment -4,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,0030010038791121685,accountNumber,0030010038731101965,850,USD,Test Payee Payment -5,72aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,0030010038791121686,accountNumber,0030010038741201606,222,USD,Test Payee Payment -6,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,0030010038791121687,accountNumber,0030010038731101967,850,USD,Test Payee Payment -7,72aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,0030010038791121688,accountNumber,0030010038741201608,222,USD,Test Payee Payment -8,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,0030010038791121689,accountNumber,0030010038731101969,850,USD,Test Payee Payment -9,72aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,0030010038791121680,accountNumber,0030010038741201600,222,USD,Test Payee Payment \ No newline at end of file +0,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,0030010038791121681,accountNumber,0030010038731101961,850,TZS,Test Payee Payment +1,72aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,0030010038791121682,accountNumber,0030010038741201602,222,TZS,Test Payee Payment +2,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,0030010038791121683,accountNumber,0030010038731101963,850,TZS,Test Payee Payment +3,72aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,0030010038791121684,accountNumber,0030010038741201604,222,TZS,Test Payee Payment +4,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,0030010038791121685,accountNumber,0030010038731101965,850,TZS,Test Payee Payment +5,72aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,0030010038791121686,accountNumber,0030010038741201606,222,TZS,Test Payee Payment +6,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,0030010038791121687,accountNumber,0030010038731101967,850,TZS,Test Payee Payment +7,72aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,0030010038791121688,accountNumber,0030010038741201608,222,TZS,Test Payee Payment +8,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,0030010038791121689,accountNumber,0030010038731101969,850,TZS,Test Payee Payment +9,72aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,0030010038791121680,accountNumber,0030010038741201600,222,TZS,Test Payee Payment diff --git a/src/test/java/resources/batch_demo_csv/ph-ee-bulk-demo-7.csv b/src/test/java/resources/batch_demo_csv/ph-ee-bulk-demo-7.csv index f3bcd6327..e4b8edd76 100644 --- a/src/test/java/resources/batch_demo_csv/ph-ee-bulk-demo-7.csv +++ b/src/test/java/resources/batch_demo_csv/ph-ee-bulk-demo-7.csv @@ -1,4 +1,4 @@ id,request_id,payment_mode,payer_identifier_type,payer_identifier,payee_identifier_type,payee_identifier,amount,currency,note -0,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,103873110196,850,USD,Test Payee Payment -1,72aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,003001003879112168,accountNumber,103874120160,222,USD,Test Payee Payment -2,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,103873110195,840,USD,Test Payee Payment \ No newline at end of file +0,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,103873110196,850,TZS,Test Payee Payment +1,72aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,003001003879112168,accountNumber,103874120160,222,TZS,Test Payee Payment +2,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,103873110195,840,TZS,Test Payee Payment diff --git a/src/test/java/resources/batch_demo_csv/ph-ee-bulk-demoErrorAsync-6.csv b/src/test/java/resources/batch_demo_csv/ph-ee-bulk-demoErrorAsync-6.csv index 3572bb070..4d6bb4fc0 100644 --- a/src/test/java/resources/batch_demo_csv/ph-ee-bulk-demoErrorAsync-6.csv +++ b/src/test/java/resources/batch_demo_csv/ph-ee-bulk-demoErrorAsync-6.csv @@ -1,6 +1,6 @@ id,request_id,payment_mode,payer_identifier_type,payer_identifier,payee_identifier_type,payee_identifier,amount,currency,note -0,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,msisdn,8353224161,msisdn,277138039121,10,USD,Moja bulk test 1 -1,39f6ac4d052e-72aa3ea4-e6f6-4880-877f,mojaloop,msisdn,8353224162,msisdn,277138039122,10,USD,Moja bulk test 2 -2,a27631f6-6dd4-4d69-b4fc-8932bd721913,mojaloop,msisdn,8353224163,msisdn,277138039124,10,USD,Moja bulk test 3 -3,3d21e6ea-c583-44ed-b94f-af909fa7616e,mojaloop,msisdn,8353224164,msisdn,277138039125,10,USD,Moja bulk test 4 -4,15f9a0b0-2299-436d-8433-da564140ba66,mojaloop,msisdn,55dghsdg667,msisdn,27713803912,10,USD,Moja bulk test 5 \ No newline at end of file +0,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,msisdn,8353224161,msisdn,277138039121,10,TZS,Moja bulk test 1 +1,39f6ac4d052e-72aa3ea4-e6f6-4880-877f,mojaloop,msisdn,8353224162,msisdn,277138039122,10,TZS,Moja bulk test 2 +2,a27631f6-6dd4-4d69-b4fc-8932bd721913,mojaloop,msisdn,8353224163,msisdn,277138039124,10,TZS,Moja bulk test 3 +3,3d21e6ea-c583-44ed-b94f-af909fa7616e,mojaloop,msisdn,8353224164,msisdn,277138039125,10,TZS,Moja bulk test 4 +4,15f9a0b0-2299-436d-8433-da564140ba66,mojaloop,msisdn,55dghsdg667,msisdn,27713803912,10,TZS,Moja bulk test 5 diff --git a/src/test/java/resources/batch_demo_csv/ph-ee-bulk-demoErrorSync-6.csv b/src/test/java/resources/batch_demo_csv/ph-ee-bulk-demoErrorSync-6.csv index 13736b594..e1cb4ca46 100644 --- a/src/test/java/resources/batch_demo_csv/ph-ee-bulk-demoErrorSync-6.csv +++ b/src/test/java/resources/batch_demo_csv/ph-ee-bulk-demoErrorSync-6.csv @@ -1,6 +1,6 @@ id,request_id,paymentmode,payer_identifier_type,payer_identifier,payee_identifier_type,payee_identifier,amount,currency,note -0,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,msisdn,835322416,msisdn,27713803912,10,USD,Moja bulk test 1 -1,39f6ac4d052e-72aa3ea4-e6f6-4880-877f,mojaloop,msisdn,835322416,msisdn,27713803912,10,USD,Moja bulk test 2 -2,a27631f6-6dd4-4d69-b4fc-8932bd721913,mojaloop,msisdn,835322416,msisdn,27713803912,10,USD,Moja bulk test 3 -3,3d21e6ea-c583-44ed-b94f-af909fa7616e,mojaloop,msisdn,835322416,msisdn,27713803912,10,USD,Moja bulk test 4 -4,15f9a0b0-2299-436d-8433-da564140ba66,mojaloop,msisdn,835322416,msisdn,27713803912,10,USD,Moja bulk test 5 \ No newline at end of file +0,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,msisdn,835322416,msisdn,27713803912,10,TZS,Moja bulk test 1 +1,39f6ac4d052e-72aa3ea4-e6f6-4880-877f,mojaloop,msisdn,835322416,msisdn,27713803912,10,TZS,Moja bulk test 2 +2,a27631f6-6dd4-4d69-b4fc-8932bd721913,mojaloop,msisdn,835322416,msisdn,27713803912,10,TZS,Moja bulk test 3 +3,3d21e6ea-c583-44ed-b94f-af909fa7616e,mojaloop,msisdn,835322416,msisdn,27713803912,10,TZS,Moja bulk test 4 +4,15f9a0b0-2299-436d-8433-da564140ba66,mojaloop,msisdn,835322416,msisdn,27713803912,10,TZS,Moja bulk test 5 diff --git a/src/test/java/resources/batch_demo_csv/ph-ee-bulk-splitting.csv b/src/test/java/resources/batch_demo_csv/ph-ee-bulk-splitting.csv index 1a2bd83ec..abc4f0ae0 100644 --- a/src/test/java/resources/batch_demo_csv/ph-ee-bulk-splitting.csv +++ b/src/test/java/resources/batch_demo_csv/ph-ee-bulk-splitting.csv @@ -1,13 +1,13 @@ id,request_id,payment_mode,payer_identifier_type,payer_identifier,payee_identifier_type,payee_identifier,amount,currency,note -0,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,003001003873110196,850,USD,Test Payee Payment -1,72aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,003001003879112168,accountNumber,003001003874120160,222,USD,Test Payee Payment -2,a1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,003001003873110196,840,USD,Test Payee Payment -3,l1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,003001003873110196,830,USD,Test Payee Payment -4,k2aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,003001003879112168,accountNumber,003001003874120160,333,USD,Test Payee Payment -5,c1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,003001003873110196,820,USD,Test Payee Payment -6,x1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,003001003873110196,810,USD,Test Payee Payment -7,m2aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,003001003879112168,accountNumber,003001003874120160,444,USD,Test Payee Payment -8,p1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,003001003873110196,800,USD,Test Payee Payment -9,q1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,003001003873110196,860,USD,Test Payee Payment -10,e2aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,003001003879112168,accountNumber,003001003874120160,555,USD,Test Payee Payment -11,t1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,003001003873110196,870,USD,Test Payee Payment \ No newline at end of file +0,f1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,003001003873110196,850,TZS,Test Payee Payment +1,72aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,003001003879112168,accountNumber,003001003874120160,222,TZS,Test Payee Payment +2,a1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,003001003873110196,840,TZS,Test Payee Payment +3,l1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,003001003873110196,830,TZS,Test Payee Payment +4,k2aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,003001003879112168,accountNumber,003001003874120160,333,TZS,Test Payee Payment +5,c1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,003001003873110196,820,TZS,Test Payee Payment +6,x1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,003001003873110196,810,TZS,Test Payee Payment +7,m2aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,003001003879112168,accountNumber,003001003874120160,444,TZS,Test Payee Payment +8,p1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,003001003873110196,800,TZS,Test Payee Payment +9,q1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,003001003873110196,860,TZS,Test Payee Payment +10,e2aa3ea4-e6f6-4880-877f-39f6ac4d052e,mojaloop,accountNumber,003001003879112168,accountNumber,003001003874120160,555,TZS,Test Payee Payment +11,t1e22fe3-9740-4fba-97b6-78f43bfa7f2f,mojaloop,accountNumber,003001003879112168,accountNumber,003001003873110196,870,TZS,Test Payee Payment diff --git a/src/test/java/resources/bulkPayment.feature b/src/test/java/resources/bulkPayment.feature index 515bca356..5836d00d2 100644 --- a/src/test/java/resources/bulkPayment.feature +++ b/src/test/java/resources/bulkPayment.feature @@ -7,9 +7,9 @@ Feature: Test ability to make payment to individual with bank account And I have the registeringInstituteId "SocialWelfare" And I have the programId "Education" Given I have Fineract-Platform-TenantId for "payer" - When I call the create client endpoint for "payer" + When I call the create client endpoint for "payer" with account holder name as "Ministry of SocialWelfare" "Education" Then I call the create savings product endpoint for "payer" - When I call the create savings account endpoint for "payer" + When I call the create savings account endpoint for "payer" with accountId "123456789" Then I check whether budget account exists with accoundId "123456789" Then I call the interop identifier endpoint for "payer" and accountId "123456789" Then I approve the deposit for Budget Account with command "approve" for "payer" @@ -19,9 +19,9 @@ Feature: Test ability to make payment to individual with bank account Then I add "payer" with account id "123456789" to als - When I call the create client endpoint for "payer" + When I call the create client endpoint for "payer" with account holder name as "Ministry of SocialWelfare" "Cash Transfer" Then I call the create savings product endpoint for "payer" - When I call the create savings account endpoint for "payer" + When I call the create savings account endpoint for "payer" with accountId "223456789" Then I check whether budget account exists with accoundId "223456789" Then I call the interop identifier endpoint for "payer" and accountId "223456789" Then I approve the deposit for Budget Account with command "approve" for "payer" @@ -30,9 +30,9 @@ Feature: Test ability to make payment to individual with bank account Then I add "payer" with account id "223456789" to als - When I call the create client endpoint for "payer" + When I call the create client endpoint for "payer" with account holder name as "Ministry of Health" "Maternity" Then I call the create savings product endpoint for "payer" - When I call the create savings account endpoint for "payer" + When I call the create savings account endpoint for "payer" with accountId "323456789" Then I check whether budget account exists with accoundId "323456789" Then I call the interop identifier endpoint for "payer" and accountId "323456789" Then I approve the deposit for Budget Account with command "approve" for "payer" @@ -41,9 +41,9 @@ Feature: Test ability to make payment to individual with bank account Then I add "payer" with account id "323456789" to als Given I have Fineract-Platform-TenantId for "payee1" - When I call the create client endpoint for "payee" + When I call the create client endpoint for "payee" with account holder name as "Maria" "Borges" Then I call the create savings product endpoint for "payee" - When I call the create savings account endpoint for "payee" + When I call the create savings account endpoint for "payee" with accountId "1234" Then I check whether budget account exists with accoundId "1234" Then I call the interop identifier endpoint for "payee" and accountId "1234" Then I approve the deposit for Budget Account with command "approve" for "payee" @@ -52,9 +52,9 @@ Feature: Test ability to make payment to individual with bank account Then I add "payee1" with account id "1234" to als Given I have Fineract-Platform-TenantId for "payee2" - When I call the create client endpoint for "payee" + When I call the create client endpoint for "payee" with account holder name as "Claudia" "Benezeth Lubao" Then I call the create savings product endpoint for "payee" - When I call the create savings account endpoint for "payee" + When I call the create savings account endpoint for "payee" with accountId "2235" Then I check whether budget account exists with accoundId "2235" Then I call the interop identifier endpoint for "payee" and accountId "2235" Then I approve the deposit for Budget Account with command "approve" for "payee" @@ -63,9 +63,9 @@ Feature: Test ability to make payment to individual with bank account Then I add "payee2" with account id "2235" to als Given I have Fineract-Platform-TenantId for "payee3" - When I call the create client endpoint for "payee" + When I call the create client endpoint for "payee" with account holder name as "Flaviana" "Matata" Then I call the create savings product endpoint for "payee" - When I call the create savings account endpoint for "payee" + When I call the create savings account endpoint for "payee" with accountId "3235" Then I check whether budget account exists with accoundId "3235" Then I call the interop identifier endpoint for "payee" and accountId "3235" Then I approve the deposit for Budget Account with command "approve" for "payee" @@ -82,114 +82,45 @@ Feature: Test ability to make payment to individual with bank account Then I call the register beneficiary API with expected status of 202 and stub "/registerBeneficiary" And I should be able to verify that the "PUT" method to "/registerBeneficiary" endpoint received a request with successfull registration - - Scenario: BB-FSP 002 Input CSV file using the batch transaction API and poll batch summary API till we get completed status + Scenario Outline: Input CSV file using the batch transaction API and poll batch summary API till we get completed status Given I have tenant as "paymentbb1" + Then Create a csv file with file name "bulk_payment.csv" + Then add row to csv with current ministry and payee "400173110196", payment mode as "closedloop" and transfer amount 100 and id 0 + Then add row to csv with current ministry and payee "400173110196", payment mode as "closedloop" and transfer amount 200 and id 1 + Then add row to csv with current ministry and payee "400174120160", payment mode as "closedloop" and transfer amount 300 and id 2 + Then add row to csv with current ministry and payee "400174120160", payment mode as "closedloop" and transfer amount 400 and id 3 + Then add row to csv with current ministry and payee "400173110195", payment mode as "closedloop" and transfer amount 700 and id 4 + Then add last row to csv with current ministry and payee "400173110195", payment mode as "closedloop" and transfer amount 800 and id 5 And I have the demo csv file "bulk_payment.csv" And I create a list of payee identifiers from csv file When I can inject MockServer Then I can start mock server - And I have the registeringInstituteId "SocialWelfare" - And I have the programId "Education" + And I have the registeringInstituteId "" + And I have the programId "" And I can register the stub with "/registerBeneficiary" endpoint for "PUT" request with status of 200 And I create a IdentityMapperDTO for registering payee with IAM Then I call the register beneficiary API with expected status of 202 and stub "/registerBeneficiary" And I should be able to verify that the "PUT" method to "/registerBeneficiary" endpoint received a request with successfull registration - And I create a new clientCorrelationId And I have private key And I generate signature - When I call the batch transactions endpoint with expected status of 202 Then I should get non empty response And I am able to parse batch transactions response And I fetch batch ID from batch transaction API's response -# Then I will sleep for 10000 millisecond Given I have tenant as "paymentbb1" When I call the batch summary API with expected status of 200 with total 6 txns Then I am able to parse batch summary response And Status of transaction is "COMPLETED" And I should have matching total txn count and successful txn count in response - - Scenario: BB-FSP 003 Input CSV file using the batch transaction API and poll batch summary API till we get completed status - Given I have tenant as "paymentbb1" - And I have the demo csv file "bulk_payment.csv" - And I create a list of payee identifiers from csv file - When I can inject MockServer - Then I can start mock server - And I have the registeringInstituteId "SocialWelfare" - And I have the programId "UnconditionalCashTransfer" - And I can register the stub with "/registerBeneficiary" endpoint for "PUT" request with status of 200 - And I create a IdentityMapperDTO for registering payee with IAM - Then I call the register beneficiary API with expected status of 202 and stub "/registerBeneficiary" - And I should be able to verify that the "PUT" method to "/registerBeneficiary" endpoint received a request with successfull registration - And I create a new clientCorrelationId - And I have private key - And I generate signature - When I call the batch transactions endpoint with expected status of 202 - Then I should get non empty response - And I am able to parse batch transactions response - And I fetch batch ID from batch transaction API's response -# Then I will sleep for 10000 millisecond - Given I have tenant as "paymentbb1" - When I call the batch summary API with expected status of 200 with total 6 txns - Then I am able to parse batch summary response - And Status of transaction is "COMPLETED" - And I should have matching total txn count and successful txn count in response + Examples: + | registeringInstituteId | programId | + | SocialWelfare | Education | + | SocialWelfare | UnconditionalCashTransfer | + | Health | Maternity | - Scenario: BB-FSP 004 Input CSV file using the batch transaction API and poll batch summary API till we get completed status - Given I have tenant as "paymentbb1" - And I have the demo csv file "bulk_payment.csv" - And I create a list of payee identifiers from csv file - When I can inject MockServer - Then I can start mock server - And I have the registeringInstituteId "Health" - And I have the programId "Maternity" - And I can register the stub with "/registerBeneficiary" endpoint for "PUT" request with status of 200 - And I create a IdentityMapperDTO for registering payee with IAM - Then I call the register beneficiary API with expected status of 202 and stub "/registerBeneficiary" - And I should be able to verify that the "PUT" method to "/registerBeneficiary" endpoint received a request with successfull registration - And I create a new clientCorrelationId - And I have private key - And I generate signature - When I call the batch transactions endpoint with expected status of 202 - Then I should get non empty response - And I am able to parse batch transactions response - And I fetch batch ID from batch transaction API's response -# Then I will sleep for 10000 millisecond - Given I have tenant as "paymentbb1" - When I call the batch summary API with expected status of 200 with total 6 txns - Then I am able to parse batch summary response - And Status of transaction is "COMPLETED" - And I should have matching total txn count and successful txn count in response - - Scenario:BB-FSP 005 Input CSV file using the batch transaction API and poll batch summary API till we get completed status - Given I have tenant as "paymentbb1" - And I have the demo csv file "bulk_payment.csv" - And I create a list of payee identifiers from csv file - When I can inject MockServer - Then I can start mock server - And I have the registeringInstituteId "SocialWelfare" - And I have the programId "Education" - And I can register the stub with "/registerBeneficiary" endpoint for "PUT" request with status of 200 - And I create a IdentityMapperDTO for registering beneficiary - Then I call the register beneficiary API with expected status of 202 and stub "/registerBeneficiary" - And I should be able to verify that the "PUT" method to "/registerBeneficiary" endpoint received a request with successfull registration - And I create a new clientCorrelationId - And I have private key - And I generate signature - When I call the batch transactions endpoint with expected status of 202 - Then I should get non empty response - And I am able to parse batch transactions response - And I fetch batch ID from batch transaction API's response -# Then I will sleep for 10000 millisecond - Given I have tenant as "paymentbb1" - When I call the batch summary API with expected status of 200 with total 6 txns - Then I am able to parse batch summary response - And Status of transaction is "COMPLETED" - And I should have matching total txn count and successful txn count in response Scenario:BB-FSP 006 Bulk Transfer with ClosedLoop and Mojaloop Given I have tenant as "payerfsp" diff --git a/src/test/java/resources/mojaloop.feature b/src/test/java/resources/mojaloop.feature index d88be4fe2..7aff2f7ae 100644 --- a/src/test/java/resources/mojaloop.feature +++ b/src/test/java/resources/mojaloop.feature @@ -6,7 +6,7 @@ Feature: Mojaloop test Given I have Fineract-Platform-TenantId for "payee" When I call the create client endpoint for "payee" Then I call the create savings product endpoint for "payee" - When I call the create savings account endpoint for "payee" + When I call the create savings account endpoint for "payee" with accountId "null" Then I call the interop identifier endpoint for "payee" Then I approve the deposit with command "approve" for "payee" When I activate the account with command "activate" for "payee" @@ -23,7 +23,7 @@ Feature: Mojaloop test Given I have Fineract-Platform-TenantId for "payee" When I call the create client endpoint for "payee" Then I call the create savings product endpoint for "payee" - When I call the create savings account endpoint for "payee" + When I call the create savings account endpoint for "payee" with accountId "null" Then I call the interop identifier endpoint for "payee" Then I approve the deposit with command "approve" for "payee" When I activate the account with command "activate" for "payee" @@ -40,7 +40,7 @@ Feature: Mojaloop test Given I have Fineract-Platform-TenantId for "payee" When I call the create client endpoint for "payee" Then I call the create savings product endpoint for "payee" - When I call the create savings account endpoint for "payee" + When I call the create savings account endpoint for "payee" with accountId "null" Then I call the interop identifier endpoint for "payee" Then I approve the deposit with command "approve" for "payee" When I activate the account with command "activate" for "payee" @@ -71,7 +71,7 @@ Feature: Mojaloop test Given I have Fineract-Platform-TenantId for "" When I call the create client endpoint for "payee" Then I call the create savings product endpoint for "payee" - When I call the create savings account endpoint for "payee" + When I call the create savings account endpoint for "payee" with accountId "null" Then I call the interop identifier endpoint for "payee" Then I approve the deposit with command "approve" for "payee" When I activate the account with command "activate" for "payee" From d42e231a08d602088b4d894e50809c5b58928c56 Mon Sep 17 00:00:00 2001 From: Abhinav Mishra Date: Wed, 17 Jul 2024 15:15:00 +0530 Subject: [PATCH 15/15] Spotless Apply --- .github/workflows/jit-security.yml | 53 +++++----- .../cucumber/stepdef/BaseStepDef.java | 10 +- .../cucumber/stepdef/ErrorCodeStepDef.java | 96 +++++++++---------- .../stepdef/IdentityMapperStepDef.java | 2 - .../cucumber/stepdef/MojaloopStepDef.java | 4 +- .../stepdef/PayerFundTransferStepDef.java | 19 ++-- 6 files changed, 88 insertions(+), 96 deletions(-) diff --git a/.github/workflows/jit-security.yml b/.github/workflows/jit-security.yml index d3babba2a..35081f292 100644 --- a/.github/workflows/jit-security.yml +++ b/.github/workflows/jit-security.yml @@ -21,7 +21,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-trivy-alpine:latest - + enrich: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'enrich' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-enrichment-code' runs-on: ubuntu-22.04 @@ -31,7 +31,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-enrichment-slim:latest - + iac-misconfig-detection-kubernetes: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'iac-misconfig-detection-kubernetes' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-kubernetes-iac-misconfiguration-detection' runs-on: ubuntu-22.04 @@ -41,7 +41,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-kubescape-slim:latest - + remediation-pr: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'remediation-pr' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-remediation-pr' runs-on: ubuntu-22.04 @@ -51,7 +51,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/open-remediation-pr-alpine:latest - + secret-detection: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'secret-detection' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-secret-detection' runs-on: ubuntu-22.04 @@ -61,7 +61,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-gitleaks-alpine:latest - + software-bill-of-materials: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-bill-of-materials' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sbom' runs-on: ubuntu-22.04 @@ -72,7 +72,7 @@ jobs: with: security_control: registry.jit.io/control-syft-alpine:latest fail_if_cannot_checkout: false - + software-component-analysis-elixir: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-elixir' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -82,7 +82,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-osv-scanner-alpine:latest - + software-component-analysis-go: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-go' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -92,7 +92,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-nancy-alpine:latest - + software-component-analysis-gradle: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-gradle' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -102,7 +102,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-jit-gradle-scanner:latest - + software-component-analysis-java: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-java' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -112,7 +112,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-osv-scanner-alpine:latest - + software-component-analysis-js: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-js' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -122,7 +122,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-npm-audit-slim:latest - + software-component-analysis-php: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-php' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -132,7 +132,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-osv-scanner-alpine:latest - + software-component-analysis-poetry: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-poetry' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -142,7 +142,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-osv-scanner-alpine:latest - + software-component-analysis-python: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-python' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -152,7 +152,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-osv-scanner-alpine:latest - + software-component-analysis-trivy-csharp: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'software-component-analysis-trivy-csharp' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sca' runs-on: ubuntu-22.04 @@ -162,7 +162,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-trivy-dotnet-slim:latest - + static-code-analysis-c-cpp: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-c-cpp' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -172,7 +172,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-csharp: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-csharp' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -182,7 +182,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-go: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-go' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -192,7 +192,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-gosec-alpine:latest - + static-code-analysis-java: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-java' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -202,7 +202,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-js: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-js' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -212,7 +212,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-kotlin: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-kotlin' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -222,7 +222,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-php: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-php' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -232,7 +232,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-python-semgrep: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-python-semgrep' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -242,7 +242,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-ruby: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-ruby' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -252,7 +252,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-rust: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-rust' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -262,7 +262,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-scala: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-scala' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -272,7 +272,7 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - + static-code-analysis-swift: if: fromJSON(github.event.inputs.client_payload).payload.workflow_job_name == 'static-code-analysis-swift' && fromJSON(github.event.inputs.client_payload).payload.workflow_slug == 'workflow-sast' runs-on: ubuntu-22.04 @@ -282,4 +282,3 @@ jobs: uses: jitsecurity-controls/jit-github-action@v4.2.2 with: security_control: registry.jit.io/control-semgrep-alpine:latest - \ No newline at end of file diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/BaseStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/BaseStepDef.java index 914ec0f31..d2e6923f6 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/BaseStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/BaseStepDef.java @@ -120,12 +120,8 @@ protected String generateSignature(String clientCorrelationId, String tenant, St System.out.println("File Content: " + fileContent); } - JsonWebSignature jsonWebSignature = new JsonWebSignature.JsonWebSignatureBuilder() - .setClientCorrelationId(clientCorrelationId) - .setTenantId(tenant) - .setIsDataAsFile(isDataAFile) - .setData(filePathOrData) - .build(); + JsonWebSignature jsonWebSignature = new JsonWebSignature.JsonWebSignatureBuilder().setClientCorrelationId(clientCorrelationId) + .setTenantId(tenant).setIsDataAsFile(isDataAFile).setData(filePathOrData).build(); // More debug statements System.out.println("Generated JsonWebSignature Object: " + jsonWebSignature); @@ -133,8 +129,6 @@ protected String generateSignature(String clientCorrelationId, String tenant, St return jsonWebSignature.getSignature(scenarioScopeState.privateKeyString); } - - private void assertNonEmptyArray(List objects) { assertNotNull(objects); assertThat(objects).isNotEmpty(); diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/ErrorCodeStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/ErrorCodeStepDef.java index 7425358b5..53db33988 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/ErrorCodeStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/ErrorCodeStepDef.java @@ -179,17 +179,17 @@ public void iCanCreateGSMATransactionDTOWithMissingCurrency() { Fee fee = gsmaTransferHelper.feeHelper("11", "TZS", "string"); GsmaParty debitParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "449999999"); GsmaParty creditParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "+449999112"); - InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper - .internationalTransferInformationHelper("string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); + InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper.internationalTransferInformationHelper( + "string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "Tanzania", "2022-09-28T12:51:19.260+00:00", "2022-09-28T12:51:19.260+00:00", "string", "string"); PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "Tanzania", "string", "string"); SubjectName subjectName = gsmaTransferHelper.subjectNameHelper("string", "string", "string", "string", "string"); - Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", - postalAddress, subjectName); - Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", - postalAddress, subjectName); + Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", + "string", postalAddress, subjectName); + Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", + "string", postalAddress, subjectName); try { gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("11", debitParty, creditParty, "", "string", "string", "string", "transfer", "string", fee, "37.423825,-122.082900", internationalTransferInformation, "string", receiverKyc, @@ -205,17 +205,17 @@ public void iCanCreateGSMATransactionDTOWithSamePayerAndPayee() { Fee fee = gsmaTransferHelper.feeHelper("11", "TZS", "string"); GsmaParty debitParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "+449999112"); GsmaParty creditParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "+449999112"); - InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper - .internationalTransferInformationHelper("string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); + InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper.internationalTransferInformationHelper( + "string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "Tanzania", "2022-09-28T12:51:19.260+00:00", "2022-09-28T12:51:19.260+00:00", "string", "string"); PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "Tanzania", "string", "string"); SubjectName subjectName = gsmaTransferHelper.subjectNameHelper("string", "string", "string", "string", "string"); - Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", - postalAddress, subjectName); - Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", - postalAddress, subjectName); + Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", + "string", postalAddress, subjectName); + Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", + "string", postalAddress, subjectName); try { gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("11", debitParty, creditParty, "TZS", "string", "string", "string", "transfer", "string", fee, "37.423825,-122.082900", internationalTransferInformation, "string", receiverKyc, @@ -231,17 +231,17 @@ public void iCanCreateGSMATransactionDTOWithNegativeAmount() { Fee fee = gsmaTransferHelper.feeHelper("11", "TZS", "string"); GsmaParty debitParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "+449999999"); GsmaParty creditParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "+449999112"); - InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper - .internationalTransferInformationHelper("string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); + InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper.internationalTransferInformationHelper( + "string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "Tanzania", "2022-09-28T12:51:19.260+00:00", "2022-09-28T12:51:19.260+00:00", "string", "string"); PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "Tanzania", "string", "string"); SubjectName subjectName = gsmaTransferHelper.subjectNameHelper("string", "string", "string", "string", "string"); - Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", - postalAddress, subjectName); - Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", - postalAddress, subjectName); + Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", + "string", postalAddress, subjectName); + Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", + "string", postalAddress, subjectName); try { gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("-11", debitParty, creditParty, "TZS", "string", "string", "string", "transfer", "string", fee, "37.423825,-122.082900", internationalTransferInformation, "string", receiverKyc, @@ -258,17 +258,17 @@ public void iCanCreateGSMATransactionDTOWithInvalidAmountFormat() { Fee fee = gsmaTransferHelper.feeHelper("11", "TZS", "string"); GsmaParty debitParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "449999999"); GsmaParty creditParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "+449999112"); - InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper - .internationalTransferInformationHelper("string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); + InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper.internationalTransferInformationHelper( + "string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "Tanzania", "2022-09-28T12:51:19.260+00:00", "2022-09-28T12:51:19.260+00:00", "string", "string"); PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "Tanzania", "string", "string"); SubjectName subjectName = gsmaTransferHelper.subjectNameHelper("string", "string", "string", "string", "string"); - Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", - postalAddress, subjectName); - Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", - postalAddress, subjectName); + Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", + "string", postalAddress, subjectName); + Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", + "string", postalAddress, subjectName); try { gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("ab", debitParty, creditParty, "TZS", "string", "string", "string", "transfer", "string", fee, "37.423825,-122.082900", internationalTransferInformation, "string", receiverKyc, @@ -284,17 +284,17 @@ public void iCanCreateGSMATransferDTOWithIncorrectPayerHelper() { Fee fee = gsmaTransferHelper.feeHelper("11", "TZS", "string"); GsmaParty debitParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "449999"); GsmaParty creditParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "835322416"); - InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper - .internationalTransferInformationHelper("string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); + InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper.internationalTransferInformationHelper( + "string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "Tanzania", "2022-09-28T12:51:19.260+00:00", "2022-09-28T12:51:19.260+00:00", "string", "string"); PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "Tanzania", "string", "string"); SubjectName subjectName = gsmaTransferHelper.subjectNameHelper("string", "string", "string", "string", "string"); - Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", - postalAddress, subjectName); - Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", - postalAddress, subjectName); + Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", + "string", postalAddress, subjectName); + Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", + "string", postalAddress, subjectName); try { gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("11", debitParty, creditParty, "TZS", "string", "string", "string", "transfer", "string", fee, "37.423825,-122.082900", internationalTransferInformation, "string", receiverKyc, @@ -310,17 +310,17 @@ public void iCanCreateGSMATransferDTOWithPayerInsufficientBalance() { Fee fee = gsmaTransferHelper.feeHelper("110", "TZS", "string"); GsmaParty debitParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "835322416"); GsmaParty creditParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "398714218"); - InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper - .internationalTransferInformationHelper("string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); + InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper.internationalTransferInformationHelper( + "string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "Tanzania", "2022-09-28T12:51:19.260+00:00", "2022-09-28T12:51:19.260+00:00", "string", "string"); PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "Tanzania", "string", "string"); SubjectName subjectName = gsmaTransferHelper.subjectNameHelper("string", "string", "string", "string", "string"); - Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", - postalAddress, subjectName); - Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", - postalAddress, subjectName); + Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", + "string", postalAddress, subjectName); + Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", + "string", postalAddress, subjectName); try { gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("11000", debitParty, creditParty, "TZS", "string", "string", "string", "transfer", "string", fee, "37.423825,-122.082900", internationalTransferInformation, "string", @@ -336,17 +336,17 @@ public void iCanCreateGSMATransferDTOWithInvalidData() { Fee fee = gsmaTransferHelper.feeHelper("11", "TZS", "string"); GsmaParty debitParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "449999hhhhdsda"); GsmaParty creditParty = gsmaTransferHelper.gsmaPartyHelper("msisdn", "835322416ffgg"); - InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper - .internationalTransferInformationHelper("string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); + InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper.internationalTransferInformationHelper( + "string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "Tanzania", "2022-09-28T12:51:19.260+00:00", "2022-09-28T12:51:19.260+00:00", "string", "string"); PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "Tanzania", "string", "string"); SubjectName subjectName = gsmaTransferHelper.subjectNameHelper("string", "string", "string", "string", "string"); - Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", - postalAddress, subjectName); - Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", - postalAddress, subjectName); + Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", + "string", postalAddress, subjectName); + Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", + "string", postalAddress, subjectName); try { gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("11", debitParty, creditParty, "TZS", "string", "string", "string", "transfer", "string", fee, "37.423825,-122.082900", internationalTransferInformation, "string", receiverKyc, @@ -384,17 +384,17 @@ public void iCanCreateGSMATransactionDTOWithDifferentPayerAndPayee() { Fee fee = gsmaTransferHelper.feeHelper("11", "TZS", "string"); GsmaParty debit = gsmaTransferHelper.gsmaPartyHelper("msisdn", scenarioScopeState.debitParty); GsmaParty credit = gsmaTransferHelper.gsmaPartyHelper("msisdn", scenarioScopeState.creditParty); - InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper - .internationalTransferInformationHelper("string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); + InternationalTransferInformation internationalTransferInformation = gsmaTransferHelper.internationalTransferInformationHelper( + "string", "string", "directtoaccount", "Tanzania", "Tanzania", "Tanzania", "Tanzania"); IdDocument idDocument = gsmaTransferHelper.idDocumentHelper("passport", "string", "Tanzania", "2022-09-28T12:51:19.260+00:00", "2022-09-28T12:51:19.260+00:00", "string", "string"); PostalAddress postalAddress = gsmaTransferHelper.postalAddressHelper("string", "string", "string", "string", "Tanzania", "string", "string"); SubjectName subjectName = gsmaTransferHelper.subjectNameHelper("string", "string", "string", "string", "string"); - Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", - postalAddress, subjectName); - Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", "string", - postalAddress, subjectName); + Kyc senderKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", + "string", postalAddress, subjectName); + Kyc receiverKyc = gsmaTransferHelper.kycHelper("Tanzania", "2000-11-20", "string", "string", "string", 'm', idDocument, "Tanzania", + "string", postalAddress, subjectName); scenarioScopeState.gsmaP2PAmtDebit = 11; try { ErrorCodeStepDef.gsmaTransaction = gsmaTransferHelper.gsmaTransactionRequestBodyHelper("11", debit, credit, "TZS", "string", diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/IdentityMapperStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/IdentityMapperStepDef.java index d0c9641d6..a8dce42ad 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/IdentityMapperStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/IdentityMapperStepDef.java @@ -25,10 +25,8 @@ import java.io.File; import java.util.ArrayList; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Set; import java.util.UUID; import org.json.JSONArray; import org.json.JSONException; diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java index c1ce820d5..3f839c578 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/MojaloopStepDef.java @@ -120,8 +120,8 @@ public void addBudgetAccountToALS(String client, String accountId) throws JsonPr String response = RestAssured.given(requestSpec).baseUri(mojaloopConfig.mojaloopBaseurl) .config(RestAssured.config().encoderConfig(encoderConfig().appendDefaultContentCharsetToContentTypeIfUndefined(false))) - .body(requestBody).contentType(CONTENT_TYPE).expect() - .spec(new ResponseSpecBuilder().expectStatusCode(202).build()).when().post(endpoint).andReturn().asString(); + .body(requestBody).contentType(CONTENT_TYPE).expect().spec(new ResponseSpecBuilder().expectStatusCode(202).build()).when() + .post(endpoint).andReturn().asString(); logger.info(response); assertThat(response).isNotNull(); diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java index 55c1458e0..8f6761119 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java @@ -98,8 +98,7 @@ public void callCreateClientEndpoint(String client, String firstName, String las RequestSpecification requestSpec = Utils.getDefaultSpec(); requestSpec = fundTransferDef.setHeaders(requestSpec); logger.info(client); - if(firstName == null) - { + if (firstName == null) { firstName = "Claudia"; lastName = "Cardinale"; } @@ -139,7 +138,7 @@ public void callCreateSavingsAccountEndpoint(String client, String interopId) th // Setting headers and body RequestSpecification requestSpec = Utils.getDefaultSpec(); requestSpec = fundTransferDef.setHeaders(requestSpec); - interopId = UUID.randomUUID().toString(); + interopId = UUID.randomUUID().toString(); fundTransferDef.savingsAccountBody = fundTransferDef.setBodySavingsAccount(client, interopId); // Calling savings product endpoint @@ -775,9 +774,10 @@ public void budgetAccountExistsWithAccoundId(String accountId) throws JsonProces } @Then("add row to csv with current ministry and payee {string}, payment mode as {string} and transfer amount {int} and id {int}") - public void addRowToCsvWithCurrentMinistryAndPayeePaymentModeAsAndTransferAmountAndId(String payee_identifier, String paymentMode, int transferAmount, int id) throws IOException { - String[] row = { String.valueOf(id), UUID.randomUUID().toString(), paymentMode, "msisdn", "N/A", - "msisdn", payee_identifier, String.valueOf(transferAmount), "TZS", "Test Payee Payment" }; + public void addRowToCsvWithCurrentMinistryAndPayeePaymentModeAsAndTransferAmountAndId(String payee_identifier, String paymentMode, + int transferAmount, int id) throws IOException { + String[] row = { String.valueOf(id), UUID.randomUUID().toString(), paymentMode, "msisdn", "N/A", "msisdn", payee_identifier, + String.valueOf(transferAmount), "TZS", "Test Payee Payment" }; String filePath = Utils.getAbsoluteFilePathToResource(scenarioScopeState.filename); scenarioScopeState.batchDebitAmt = scenarioScopeState.batchDebitAmt + transferAmount; if (scenarioScopeState.bulkTransactionList == null) { @@ -788,9 +788,10 @@ public void addRowToCsvWithCurrentMinistryAndPayeePaymentModeAsAndTransferAmount } @Then("add last row to csv with current ministry and payee {string}, payment mode as {string} and transfer amount {int} and id {int}") - public void addLastRowToCsvWithCurrentMinistryAndPayeePaymentModeAsAndTransferAmountAndId(String payee_identifier, String paymentMode, int transferAmount, int id) throws IOException { - String[] row = { String.valueOf(id), UUID.randomUUID().toString(), paymentMode, "msisdn", "N/A", - "msisdn", payee_identifier, String.valueOf(transferAmount), "TZS", "Test Payee Payment" }; + public void addLastRowToCsvWithCurrentMinistryAndPayeePaymentModeAsAndTransferAmountAndId(String payee_identifier, String paymentMode, + int transferAmount, int id) throws IOException { + String[] row = { String.valueOf(id), UUID.randomUUID().toString(), paymentMode, "msisdn", "N/A", "msisdn", payee_identifier, + String.valueOf(transferAmount), "TZS", "Test Payee Payment" }; String filePath = Utils.getAbsoluteFilePathToResource(scenarioScopeState.filename); csvHelper.addLastRow(filePath, row); scenarioScopeState.batchDebitAmt = scenarioScopeState.batchDebitAmt + transferAmount;