diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/cob/CobPartitioningTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/cob/CobPartitioningTest.java index 37fa5100399..79089f6e814 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/cob/CobPartitioningTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/cob/CobPartitioningTest.java @@ -46,9 +46,7 @@ import org.apache.fineract.integrationtests.common.BusinessStepHelper; import org.apache.fineract.integrationtests.common.ClientHelper; import org.apache.fineract.integrationtests.common.CollateralManagementHelper; -import org.apache.fineract.integrationtests.common.ExternalAssetOwnerHelper; import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper; -import org.apache.fineract.integrationtests.common.SchedulerJobHelper; import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.accounting.Account; import org.apache.fineract.integrationtests.common.accounting.AccountHelper; @@ -81,9 +79,7 @@ public class CobPartitioningTest { private static Account INCOME_ACCOUNT; private static Account OVERPAYMENT_ACCOUNT; private static FinancialActivityAccountHelper FINANCIAL_ACTIVITY_ACCOUNT_HELPER; - private static ExternalAssetOwnerHelper EXTERNAL_ASSET_OWNER_HELPER; private static LoanTransactionHelper LOAN_TRANSACTION_HELPER; - private static SchedulerJobHelper SCHEDULER_JOB_HELPER; private static LocalDate TODAYS_DATE; @BeforeAll @@ -93,8 +89,6 @@ public static void setupInvestorBusinessStep() { REQUEST_SPEC.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey()); RESPONSE_SPEC = new ResponseSpecBuilder().expectStatusCode(200).build(); AccountHelper accountHelper = new AccountHelper(REQUEST_SPEC, RESPONSE_SPEC); - EXTERNAL_ASSET_OWNER_HELPER = new ExternalAssetOwnerHelper(); - SCHEDULER_JOB_HELPER = new SchedulerJobHelper(REQUEST_SPEC); FINANCIAL_ACTIVITY_ACCOUNT_HELPER = new FinancialActivityAccountHelper(REQUEST_SPEC); LOAN_TRANSACTION_HELPER = new LoanTransactionHelper(REQUEST_SPEC, RESPONSE_SPEC); @@ -133,10 +127,11 @@ public void testLoanCOBPartitioningQuery() throws InterruptedException { // Let's create 1, 2, ..., N-1, N loans final CountDownLatch createLatch = new CountDownLatch(N); + Integer loanProductID = createLoanProduct(); for (int i = 0; i < N; i++) { Future unused = executorService.submit(() -> { Integer clientID = createClient(); - Integer loanID = createLoanForClient(clientID); + Integer loanID = createLoanForClient(clientID, loanProductID); loanIds.add(loanID); createLatch.countDown(); }); @@ -200,14 +195,19 @@ private Integer createClient() { return clientID; } - @NotNull - private Integer createLoanForClient(Integer clientID) { + private Integer createLoanProduct() { Integer overdueFeeChargeId = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC, ChargesHelper.getLoanOverdueFeeJSONWithCalculationTypePercentage("1")); Assertions.assertNotNull(overdueFeeChargeId); Integer loanProductID = createLoanProduct(overdueFeeChargeId.toString()); Assertions.assertNotNull(loanProductID); + return loanProductID; + } + + @NotNull + private Integer createLoanForClient(Integer clientID, Integer loanProductID) { + HashMap loanStatusHashMap; Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), "10 January 2020");