From 1db87b1e12cad007b6703e39d0c5c465974f65ac Mon Sep 17 00:00:00 2001 From: Adam Saghy Date: Mon, 29 Jul 2024 14:09:43 +0200 Subject: [PATCH] FINERACT-2081: Fix date handling of refund tests cases --- .../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 charges, final String savingsId, String principal, final String repaymentStrategy, final int month, + List charges, final String savingsId, String principal, final String repaymentStrategy, final String fourMonthsfromNow, List 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") //