From dd09003f5f02801bf038cae0fb2d641b5e68a5d3 Mon Sep 17 00:00:00 2001 From: Vishwas Babu A J Date: Tue, 5 Mar 2019 15:04:55 -0800 Subject: [PATCH] FINERACT-720 updating test cases to reflect changes to Annual fees functionality --- .../integrationtests/SchedulerJobsTestResults.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SchedulerJobsTestResults.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SchedulerJobsTestResults.java index 2cc98b372f2..64a4d13baff 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SchedulerJobsTestResults.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SchedulerJobsTestResults.java @@ -24,6 +24,8 @@ import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.ZoneId; import java.util.ArrayList; import java.util.Calendar; import java.util.HashMap; @@ -136,7 +138,6 @@ public void testApplyAnnualFeeForSavingsJobOutcome() throws InterruptedException savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId); SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap); - HashMap summaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId); String JobName = "Apply Annual Fee For Savings"; this.schedulerJobHelper.executeJob(JobName); @@ -144,9 +145,14 @@ public void testApplyAnnualFeeForSavingsJobOutcome() throws InterruptedException Float chargeAmount = (Float) chargeData.get("amount"); - final HashMap summaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId); - Assert.assertEquals("Verifying Annual Fee after Running Scheduler Job for Apply Anual Fee", chargeAmount, - (Float) summaryAfter.get("totalAnnualFees")); + final HashMap savingsDetails = this.savingsAccountHelper.getSavingsDetails(savingsId); + final HashMap annualFeeDetails = (HashMap) savingsDetails.get("annualFee"); + ArrayList annualFeeDueDateAsArrayList = (ArrayList) annualFeeDetails.get("dueDate"); + LocalDate nextDueDateForAnnualFee = LocalDate.of(annualFeeDueDateAsArrayList.get(0), annualFeeDueDateAsArrayList.get(1), annualFeeDueDateAsArrayList.get(2)); + LocalDate todaysDate = LocalDate.now(ZoneId.of("Asia/Kolkata")); + + Assert.assertTrue("Verifying that all due Annual Fees have been paid ", + nextDueDateForAnnualFee.isAfter(todaysDate)); }