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 1db87b1e1 FINERACT-2081: Fix date handling of refund tests cases
1db87b1e1 is described below

commit 1db87b1e12cad007b6703e39d0c5c465974f65ac
Author: Adam Saghy <[email protected]>
AuthorDate: Mon Jul 29 14:09:43 2024 +0200

    FINERACT-2081: Fix date handling of refund tests cases
---
 .../fineract/integrationtests/ClientLoanIntegrationTest.java  | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git 
a/integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java
 
b/integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java
index 348b8b9be..e372e38a7 100644
--- 
a/integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java
+++ 
b/integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java
@@ -4084,7 +4084,7 @@ public class ClientLoanIntegrationTest {
         addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));
 
         final Integer loanID = 
applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, 
charges, savingsId,
-                principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, 
collaterals);
+                principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, 
fourMonthsfromNow, collaterals);
         Assertions.assertNotNull(loanID);
         HashMap loanStatusHashMap = 
LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);
         LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -4265,7 +4265,7 @@ public class ClientLoanIntegrationTest {
         addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));
 
         final Integer loanID = 
applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, 
charges, savingsId,
-                principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, 
collaterals);
+                principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, 
fourMonthsfromNow, collaterals);
         Assertions.assertNotNull(loanID);
         HashMap loanStatusHashMap = 
LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);
         LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -4455,7 +4455,7 @@ public class ClientLoanIntegrationTest {
         addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));
 
         final Integer loanID = 
applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, 
charges, null, principal,
-                LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);
+                LoanApplicationTestBuilder.DEFAULT_STRATEGY, 
fourMonthsfromNow, collaterals);
         Assertions.assertNotNull(loanID);
         HashMap loanStatusHashMap = 
LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);
         LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -7265,15 +7265,12 @@ public class ClientLoanIntegrationTest {
     }
 
     private Integer 
applyForLoanApplicationWithPaymentStrategyAndPastMonth(final Integer clientID, 
final Integer loanProductID,
-            List<HashMap> charges, final String savingsId, String principal, 
final String repaymentStrategy, final int month,
+            List<HashMap> charges, final String savingsId, String principal, 
final String repaymentStrategy, final String fourMonthsfromNow,
             List<HashMap> collaterals) {
         LOG.info("--------------------------------APPLYING FOR LOAN 
APPLICATION--------------------------------");
 
-        Calendar fourMonthsfromNowCalendar = 
Calendar.getInstance(Utils.getTimeZoneOfTenant());
-        fourMonthsfromNowCalendar.add(Calendar.MONTH, month);
         DateFormat dateFormat = new SimpleDateFormat(DATETIME_PATTERN);
         dateFormat.setTimeZone(Utils.getTimeZoneOfTenant());
-        String fourMonthsfromNow = 
dateFormat.format(fourMonthsfromNowCalendar.getTime());
         final String loanApplicationJSON = new LoanApplicationTestBuilder() //
                 .withPrincipal(principal) //
                 .withLoanTermFrequency("6") //

Reply via email to