This is an automated email from the ASF dual-hosted git repository.

adamsaghy pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new 3e193975e FINERACT-1724  - no need to create a new loan product for 
each loan  - unused variables removed.
3e193975e is described below

commit 3e193975efa7eef5aeb1b3a6b40f2631889949bb
Author: Peter Bagrij <[email protected]>
AuthorDate: Thu Jul 27 11:14:46 2023 +0200

    FINERACT-1724
     - no need to create a new loan product for each loan
     - unused variables removed.
---
 .../integrationtests/cob/CobPartitioningTest.java      | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

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 37fa51003..79089f6e8 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.BusinessDateHelper;
 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 class CobPartitioningTest {
         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 class CobPartitioningTest {
 
             // 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 @@ public class CobPartitioningTest {
         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");

Reply via email to