Skip to content

Commit

Permalink
FINERACT-720 updating test cases to reflect changes to Annual fees fu…
Browse files Browse the repository at this point in the history
…nctionality
  • Loading branch information
vishwasbabu committed Mar 5, 2019
1 parent 655155a commit dd09003
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -136,17 +138,21 @@ 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);
final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, annualFeeChargeId);

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<Integer> annualFeeDueDateAsArrayList = (ArrayList<Integer>) 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));

}

Expand Down

0 comments on commit dd09003

Please sign in to comment.