From 0c6903fc369550c792e4be7c94fb7c558dd2390b Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Mon, 1 Jun 2020 15:46:08 +0200 Subject: [PATCH] executeAndAwaitJob() instead executeJob() in un-ignored FixedDepositTest re. FINERACT-950 and FINERACT-922 --- .../integrationtests/FixedDepositTest.java | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FixedDepositTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FixedDepositTest.java index 4d88061ad..64f7c6645 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FixedDepositTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FixedDepositTest.java @@ -510,7 +510,7 @@ public class FixedDepositTest { SchedulerJobHelper schedulerJobHelper = new SchedulerJobHelper(requestSpec); String JobName = "Update Deposit Accounts Maturity details"; - schedulerJobHelper.executeJob(JobName); + schedulerJobHelper.executeAndAwaitJob(JobName); HashMap accountDetails = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec, fixedDepositAccountId); @@ -1493,7 +1493,7 @@ public class FixedDepositTest { Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth); principal += interestPerMonth; todaysDate.add(Calendar.DATE, daysInMonth); - LOG.info("{}",monthDayFormat.format(todaysDate.getTime())); + LOG.info("{}",monthDayFormat.format(todaysDate.getTime())); interestPerMonth = (float) (interestPerDay * principal * currentDate); LOG.info("IPM = {}" , interestPerMonth); @@ -1604,7 +1604,7 @@ public class FixedDepositTest { Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth); principal += interestPerMonth; todaysDate.add(Calendar.DATE, daysInMonth); - LOG.info("{}",monthDayFormat.format(todaysDate.getTime())); + LOG.info("{}",monthDayFormat.format(todaysDate.getTime())); interestPerMonth = (float) (interestPerDay * principal * currentDate); LOG.info("IPM = {}" , interestPerMonth); @@ -1719,7 +1719,7 @@ public class FixedDepositTest { Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth); principal += interestPerMonth; todaysDate.add(Calendar.DATE, daysInMonth); - LOG.info("{}",monthDayFormat.format(todaysDate.getTime())); + LOG.info("{}",monthDayFormat.format(todaysDate.getTime())); interestPerMonth = (float) (interestPerDay * principal * currentDate); LOG.info("IPM = {}" , interestPerMonth); @@ -2404,7 +2404,7 @@ public class FixedDepositTest { final Account liabilityAccount = this.accountHelper.createLiabilityAccount(); DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US); - DateFormat monthDayFormat = new SimpleDateFormat("dd MMM", Locale.US); + new SimpleDateFormat("dd MMM", Locale.US); DateFormat currentDateFormat = new SimpleDateFormat("dd"); Calendar todaysDate = Calendar.getInstance(); @@ -2418,14 +2418,11 @@ public class FixedDepositTest { final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime()); final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime()); final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime()); - final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime()); Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1; todaysDate.add(Calendar.DATE, numberOfDaysLeft); - final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime()); - final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime()); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Assert.assertNotNull(clientId); @@ -2489,7 +2486,7 @@ public class FixedDepositTest { final Account liabilityAccount = this.accountHelper.createLiabilityAccount(); DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US); - DateFormat monthDayFormat = new SimpleDateFormat("dd MMM", Locale.US); + new SimpleDateFormat("dd MMM", Locale.US); DateFormat currentDateFormat = new SimpleDateFormat("dd"); Calendar todaysDate = Calendar.getInstance(); @@ -2503,14 +2500,11 @@ public class FixedDepositTest { final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime()); final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime()); final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime()); - final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime()); Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1; todaysDate.add(Calendar.DATE, numberOfDaysLeft); - final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime()); - final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime()); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Assert.assertNotNull(clientId); @@ -2624,7 +2618,7 @@ public class FixedDepositTest { } private Integer applyForFixedDepositApplication(final String clientID, final String productID, final String submittedOnDate, - final String penalInterestType, final Integer maturityInstructionId) { + final String penalInterestType, final Integer maturityInstructionId) { LOG.info("--------------------------------APPLYING FOR FIXED DEPOSIT ACCOUNT --------------------------------"); final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec) // .withSubmittedOnDate(submittedOnDate)