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 6932f99df..566816a72 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/GSMATransferStepDef.java @@ -714,6 +714,28 @@ public void iCallTheBalanceApiForPayeeBalanceForCombinedTestsCases(String id) th } + @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}", creditParty.isEmpty() ? scenarioScopeState.payeeIdentifier : 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); @@ -773,6 +795,27 @@ public void iCallTheBalanceApiForPayerBalanceForCombinedTestCases(String id) thr } + @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}", debitParty.isEmpty() ? scenarioScopeState.payerIdentifier : 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 payer with id {string} balance after debit") public void iCallTheBalanceApiForPayerBalanceAfterDebit(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 c2bde221d..9a1736fdd 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/PayerFundTransferStepDef.java @@ -541,6 +541,20 @@ public void addRowToCsvFileForCombinedTestCases(String paymentMode, int transfer scenarioScopeState.gsmaP2PAmtDebitForBatch[id + 1] = transferAmount; } + @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 { @@ -605,4 +619,56 @@ public void consolidatedPayeeCreationStepsForCombinedTestsCases(String client, S } } + @When("I create and setup a {string} with id {string} and account balance of {int} for multiple payment mode bulk test cases") + public void consolidatedPayeeCreationStepsForMultpliePaymentModeTestsCases(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) { + 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) { + scenarioScopeState.initialBalForPayeeForBatch = new int[9]; + } + scenarioScopeState.initialBalForPayeeForBatch[Integer.parseInt(id)] = amount; + assertThat(scenarioScopeState.initialBalForPayeeForBatch[Integer.parseInt(id)]).isNotNull(); + } + } + + @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(); + } + } + } 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..a230764bf --- /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,4676a8cd-a9bd-4ff8-8f7f-343e15e6b06b,closedloop,msisdn,1661,msisdn,1589,10,USD,Test Payee Payment +1,c6543675-e573-4575-85fb-6e25f44a643b,closedloop,msisdn,1662,msisdn,1590,5,USD,Test Payee Payment +2,14a359d4-d37f-4eda-a5e7-c7002ae699e0,closedloop,msisdn,1663,msisdn,1591,5,USD,Test Payee Payment +3,36472026-28d2-4203-8f0f-8489ea04ae36,closedloop,msisdn,1664,msisdn,1592,5,USD,Test Payee Payment +4,ef8c31b3-43d8-4318-b2fd-d9cbb2391aa6,closedloop,msisdn,1665,msisdn,1593,5,USD,Test Payee Payment +5,7d8f65a5-f19e-4e23-93aa-c01100771f09,mojaloop,msisdn,1666,msisdn,1594,3,USD,Test Payee Payment +6,801fe779-5950-41dd-8dd7-11b0e3171674,mojaloop,msisdn,1667,msisdn,1594,2,USD,Test Payee Payment +7,a6c35b7c-432c-4cc0-8df4-0d53be2316c6,mojaloop,msisdn,1668,msisdn,1595,1,USD,Test Payee Payment \ No newline at end of file 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..cd530f199 --- /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,b0105ec7-6dec-4965-bc49-b0dcaa52b210,mojaloop,msisdn,1650,msisdn,1579,3,USD,Test Payee Payment +1,575fff97-28c8-4162-9dd2-2347fbc0b7d8,mojaloop,msisdn,1651,msisdn,1579,2,USD,Test Payee Payment +2,ab9bd2bc-54ba-4f2e-af4c-dcd92c9e0abf,mojaloop,msisdn,1652,msisdn,1580,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 3d4e2284b..92b306bc4 100644 --- a/src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoop.csv +++ b/src/test/java/resources/batch_demo_csv/batchTransactionGsmaClosedLoop.csv @@ -1,9 +1,9 @@ id,request_id,payment_mode,payer_identifier_type,payer_identifier,payee_identifier_type,payee_identifier,amount,currency,note -0,ead8a498-5f97-44ed-866e-b5729f9dc71c,closedloop,msisdn,2936,msisdn,2716,10,USD,Test Payee Payment -1,7ca27144-5994-4107-ad54-9160fbb3f6e7,closedloop,msisdn,2937,msisdn,2717,5,USD,Test Payee Payment -2,3731d077-bede-4708-bbb1-e237d1d5c13d,closedloop,msisdn,2938,msisdn,2718,5,USD,Test Payee Payment -3,e475fcde-4bf8-4fba-b2df-acbb452ffb19,closedloop,msisdn,2939,msisdn,2719,5,USD,Test Payee Payment -4,89246be1-3211-4fea-850e-d34d20617e31,closedloop,msisdn,2940,msisdn,2720,5,USD,Test Payee Payment -5,a644c842-7b81-4b66-b10b-c1ccdc5b776e,gsma,msisdn,2941,msisdn,2721,6,USD,Test Payee Payment -6,a1019717-1cdc-4a6c-82ca-15a6295fc21b,gsma,msisdn,2942,msisdn,2722,7,USD,Test Payee Payment -7,0430429d-e8ec-4fdd-b56d-37da165c236f,gsma,msisdn,2943,msisdn,2723,8,USD,Test Payee Payment \ No newline at end of file +0,4f5b3af0-e9c4-4d0d-82e1-f7a306537a78,closedloop,msisdn,1653,msisdn,1581,10,USD,Test Payee Payment +1,1f135114-f258-43ca-bde7-b1a1d35ef6b8,closedloop,msisdn,1654,msisdn,1582,5,USD,Test Payee Payment +2,9504b7a3-bd56-4b3f-a5e3-62490f15946c,closedloop,msisdn,1655,msisdn,1583,5,USD,Test Payee Payment +3,36633dc5-0ebf-438b-9e92-9454b9ec1b48,closedloop,msisdn,1656,msisdn,1584,5,USD,Test Payee Payment +4,4f2378aa-b53a-4875-bf46-d64478282a5d,closedloop,msisdn,1657,msisdn,1585,5,USD,Test Payee Payment +5,f0a69fcb-1007-4f00-b13c-5fa708c1d345,gsma,msisdn,1658,msisdn,1586,6,USD,Test Payee Payment +6,5f21b775-7a6c-4ddf-b816-be7d9e614337,gsma,msisdn,1659,msisdn,1587,7,USD,Test Payee Payment +7,de9aa5a7-a74e-49c4-9b5c-293ebbd48b65,gsma,msisdn,1660,msisdn,1588,8,USD,Test Payee Payment \ No newline at end of file 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..ba5c73d3e --- /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,aa2640cc-7b46-4843-8cd6-ae11d7fc45b4,closedloop,msisdn,1669,msisdn,1596,10,USD,Test Payee Payment +1,90a8eee0-8ca8-4b34-a83e-f9bc4a83eac9,closedloop,msisdn,1670,msisdn,1597,5,USD,Test Payee Payment +2,d4f89e0d-0250-4287-9da8-85fcb564a43d,closedloop,msisdn,1671,msisdn,1598,5,USD,Test Payee Payment +3,e2ecc8ef-4fd2-4be1-8e45-6b664f7bb475,closedloop,msisdn,1672,msisdn,1599,5,USD,Test Payee Payment +4,763fe464-c2b0-490d-847b-07ad46cf61ce,closedloop,msisdn,1673,msisdn,1600,5,USD,Test Payee Payment +5,d96b1832-01d8-420d-8e61-efb57780fbac,gsma,msisdn,1674,msisdn,1601,6,USD,Test Payee Payment +6,74c7a361-5d45-4840-99df-2a2a95a48b35,gsma,msisdn,1675,msisdn,1602,7,USD,Test Payee Payment +7,ba069ad5-7eea-4727-8d5a-3f0959146ceb,gsma,msisdn,1677,msisdn,1603,8,USD,Test Payee Payment +8,04412577-4c38-4d7c-b280-b9672c694ea2,gsma,msisdn,1678,msisdn,1605,9,USD,Test Payee Payment +9,89a6fc00-5af2-48a9-8187-1358d87941d6,gsma,msisdn,1679,msisdn,1606,10,USD,Test Payee Payment +10,53014e2d-492b-4324-b04e-b03daa6f4fc4,mojaloop,msisdn,1680,msisdn,1607,3,USD,Test Payee Payment +11,f262f423-ff62-4298-8942-fd56d71b64cf,mojaloop,msisdn,1681,msisdn,1607,2,USD,Test Payee Payment +12,3d907874-507e-4319-8399-15629c07e999,mojaloop,msisdn,1682,msisdn,1608,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 262c916e9..5782a4f3d 100644 --- a/src/test/java/resources/bulkPayment.feature +++ b/src/test/java/resources/bulkPayment.feature @@ -1,7 +1,7 @@ -@gov @ext +@gov 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-FSP 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 @@ -25,8 +25,8 @@ 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 "paymentbb1" + Scenario:BB-FSP 002 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" And I create a list of payee identifiers from csv file When I can inject MockServer @@ -42,14 +42,14 @@ Feature: Test ability to make payment to individual with bank account 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" + Then I will sleep for 10000 millisecond + Given I have tenant as "paymentBB2" 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 003 Bulk Transfer with ClosedLoop and GSMA #payer 1 creation Given I have Fineract-Platform-TenantId as "payerfsp2" When I create and setup a "payer" with id "1" and account balance of 100 for combine test cases @@ -160,3 +160,255 @@ 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 004 Bulk Transfer with Closedloop and Real Mojaloop + #payer 1 creation + Given I have Fineract-Platform-TenantId as "payerfsp2" + 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 005 Bulk Transfer with ClosedLoop, Real mojaloop and Real GSMA + #payer 1 creation + Given I have Fineract-Platform-TenantId as "payerfsp2" + 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 diff --git a/src/test/java/resources/mojaloop.feature b/src/test/java/resources/mojaloop.feature index 3cae45cf8..08205166b 100644 --- a/src/test/java/resources/mojaloop.feature +++ b/src/test/java/resources/mojaloop.feature @@ -125,7 +125,7 @@ Feature: Mojaloop test 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 + Then I will sleep for 10000 millisecond When I call the batch aggregate API with expected status of 200 with total 3 txns Then I should get non empty response Then I am able to parse batch summary response