Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ public void tearDown() {
}

@Test
@Disabled // TODO FINERACT-924
public void testApplyAnnualFeeForSavingsJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
Expand Down Expand Up @@ -149,7 +148,7 @@ public void testApplyAnnualFeeForSavingsJobOutcome() throws InterruptedException

String JobName = "Apply Annual Fee For Savings";

this.schedulerJobHelper.executeJob(JobName);
this.schedulerJobHelper.executeAndAwaitJob(JobName);
final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec,
annualFeeChargeId);

Expand All @@ -168,7 +167,6 @@ public void testApplyAnnualFeeForSavingsJobOutcome() throws InterruptedException
}

@Test
@Disabled
public void testInterestPostingForSavingsJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
Expand Down Expand Up @@ -198,7 +196,7 @@ public void testInterestPostingForSavingsJobOutcome() throws InterruptedExceptio

String JobName = "Post Interest For Savings";

this.schedulerJobHelper.executeJob(JobName);
this.schedulerJobHelper.executeAndAwaitJob(JobName);
final HashMap summaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);

Assertions.assertNotSame(summaryBefore.get("accountBalance"), summaryAfter.get("accountBalance"),
Expand All @@ -207,7 +205,6 @@ public void testInterestPostingForSavingsJobOutcome() throws InterruptedExceptio
}

@Test
@Disabled // TODO FINERACT-857
public void testTransferFeeForLoansFromSavingsJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
Expand Down Expand Up @@ -265,7 +262,7 @@ public void testTransferFeeForLoansFromSavingsJobOutcome() throws InterruptedExc
final HashMap summaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);

String JobName = "Transfer Fee For Loans From Savings";
this.schedulerJobHelper.executeJob(JobName);
this.schedulerJobHelper.executeAndAwaitJob(JobName);
final HashMap summaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);

final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec,
Expand All @@ -281,7 +278,6 @@ public void testTransferFeeForLoansFromSavingsJobOutcome() throws InterruptedExc
}

@Test
@Disabled // TODO FINERACT-923
public void testApplyHolidaysToLoansJobOutcome() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
Expand Down Expand Up @@ -342,7 +338,7 @@ public void testApplyHolidaysToLoansJobOutcome() throws InterruptedException {

String JobName = "Apply Holidays To Loans";

this.schedulerJobHelper.executeJob(JobName);
this.schedulerJobHelper.executeAndAwaitJob(JobName);
final ArrayList<HashMap> repaymentScheduleDataAfterJob = this.loanTransactionHelper
.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);

Expand All @@ -360,7 +356,6 @@ public void testApplyHolidaysToLoansJobOutcome() throws InterruptedException {
}

@Test
@Disabled // TODO FINERACT-857
public void testApplyDueFeeChargesForSavingsJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
Expand Down Expand Up @@ -398,7 +393,7 @@ public void testApplyDueFeeChargesForSavingsJobOutcome() throws InterruptedExcep

String JobName = "Pay Due Savings Charges";

this.schedulerJobHelper.executeJob(JobName);
this.schedulerJobHelper.executeAndAwaitJob(JobName);
HashMap summaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);

final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec,
Expand All @@ -413,7 +408,6 @@ public void testApplyDueFeeChargesForSavingsJobOutcome() throws InterruptedExcep
}

@Test
@Disabled // TODO FINERACT-857
public void testUpdateAccountingRunningBalancesJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
Expand Down Expand Up @@ -455,7 +449,7 @@ public void testUpdateAccountingRunningBalancesJobOutcome() throws InterruptedEx

String JobName = "Update Accounting Running Balances";

this.schedulerJobHelper.executeJob(JobName);
this.schedulerJobHelper.executeAndAwaitJob(JobName);
final HashMap runningBalanceAfter = this.accountHelper
.getAccountingWithRunningBalanceById(accountID.toString());

Expand All @@ -467,7 +461,6 @@ public void testUpdateAccountingRunningBalancesJobOutcome() throws InterruptedEx
}

@Test
@Disabled // TODO FINERACT-857
public void testUpdateLoanArrearsAgingJobOutcome() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
Expand Down Expand Up @@ -495,7 +488,7 @@ public void testUpdateLoanArrearsAgingJobOutcome() throws InterruptedException {

String JobName = "Update Loan Arrears Ageing";

this.schedulerJobHelper.executeJob(JobName);
this.schedulerJobHelper.executeAndAwaitJob(JobName);
HashMap loanSummaryData = this.loanTransactionHelper.getLoanSummary(this.requestSpec, this.responseSpec,
loanID);

Expand All @@ -508,7 +501,6 @@ public void testUpdateLoanArrearsAgingJobOutcome() throws InterruptedException {
}

@Test
@Disabled // TODO FINERACT-857
public void testUpdateLoanPaidInAdvanceJobOutcome() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
Expand Down Expand Up @@ -556,7 +548,7 @@ public void testUpdateLoanPaidInAdvanceJobOutcome() throws InterruptedException
loanID);

String JobName = "Update Loan Paid In Advance";
this.schedulerJobHelper.executeJob(JobName);
this.schedulerJobHelper.executeAndAwaitJob(JobName);
// Retrieving Loan Repayment Schedule after the successful
// completion of
// Update Loan Paid in Advance Scheduler Job
Expand Down Expand Up @@ -625,7 +617,7 @@ public void testUpdateLoanSummaryJobOutcome() throws InterruptedException {
this.responseSpec, loanID);

String JobName = "Update loan Summary";
this.schedulerJobHelper.executeJob(JobName);
this.schedulerJobHelper.executeAndAwaitJob(JobName);
Float expectedSummaryAfterJob = (Float) loanSummaryBefore.get("totalExpectedRepayment")
/* - (Float) loanSummaryBefore.get("feeChargesPaid") */;
HashMap loanSummaryAfter = this.loanTransactionHelper.getLoanSummary(this.requestSpec,
Expand All @@ -636,7 +628,6 @@ public void testUpdateLoanSummaryJobOutcome() throws InterruptedException {
}

@Test
@Disabled // TODO FINERACT-857
public void testExecuteStandingInstructionsJobOutcome() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
Expand Down Expand Up @@ -701,7 +692,7 @@ public void testExecuteStandingInstructionsJobOutcome() throws InterruptedExcept
Assertions.assertNotNull(standingInstructionId);

String JobName = "Execute Standing Instruction";
this.schedulerJobHelper.executeJob(JobName);
this.schedulerJobHelper.executeAndAwaitJob(JobName);
HashMap fromSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(fromSavingsId);
Float fromSavingsBalanceAfter = (Float) fromSavingsSummaryAfter.get("accountBalance");

Expand Down Expand Up @@ -732,7 +723,6 @@ public void testExecuteStandingInstructionsJobOutcome() throws InterruptedExcept
}

@Test
@Disabled
public void testApplyPenaltyForOverdueLoansJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
Expand Down Expand Up @@ -767,7 +757,7 @@ public void testApplyPenaltyForOverdueLoansJobOutcome() throws InterruptedExcept
.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);

String JobName = "Apply penalty to overdue loans";
this.schedulerJobHelper.executeJob(JobName);
this.schedulerJobHelper.executeAndAwaitJob(JobName);

final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec,
overdueFeeChargeId);
Expand All @@ -787,7 +777,6 @@ public void testApplyPenaltyForOverdueLoansJobOutcome() throws InterruptedExcept
}

@Test
@Disabled // TODO FINERACT-857
public void testAvoidUnncessaryPenaltyWhenAmountZeroForOverdueLoansJobOutcome() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
Expand Down Expand Up @@ -824,7 +813,7 @@ public void testAvoidUnncessaryPenaltyWhenAmountZeroForOverdueLoansJobOutcome()
String JobName = "Apply penalty to overdue loans";
Integer jobId = 12;

this.schedulerJobHelper.executeJob(JobName);
this.schedulerJobHelper.executeAndAwaitJob(JobName);

Map<String, Object> schedulerJob = this.schedulerJobHelper.getSchedulerJobById(jobId);

Expand Down Expand Up @@ -856,7 +845,6 @@ public void testAvoidUnncessaryPenaltyWhenAmountZeroForOverdueLoansJobOutcome()
}

@Test
@Disabled // TODO FINERACT-857
public void testUpdateOverdueDaysForNPA() throws InterruptedException {
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
Expand Down Expand Up @@ -887,14 +875,13 @@ public void testUpdateOverdueDaysForNPA() throws InterruptedException {
Assertions.assertFalse(isNPABefore);
// Integer jobId = (Integer) allSchedulerJobsData.get(1).get("jobId");
String JobName = "Update Non Performing Assets";
this.schedulerJobHelper.executeJob(JobName);
this.schedulerJobHelper.executeAndAwaitJob(JobName);
final Boolean isNPAAfter = (Boolean) this.loanTransactionHelper.getLoanDetail(requestSpec, responseSpec,
loanID, "isNPA");
Assertions.assertTrue(isNPAAfter);
}

@Test
@Disabled // TODO FINERACT-857
public void testInterestTransferForSavings() throws InterruptedException {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
Expand Down Expand Up @@ -977,7 +964,7 @@ public void testInterestTransferForSavings() throws InterruptedException {
- Float.valueOf(FixedDepositAccountHelper.DEPOSIT_AMOUNT);

String JobName = "Transfer Interest To Savings";
this.schedulerJobHelper.executeJob(JobName);
this.schedulerJobHelper.executeAndAwaitJob(JobName);
fixedDepositSummary = savingsAccountHelper.getSavingsSummary(fixedDepositAccountId);
assertEquals(Float.valueOf(FixedDepositAccountHelper.DEPOSIT_AMOUNT),
fixedDepositSummary.get("accountBalance"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2928,6 +2928,7 @@ public void loadLazyCollections() {
transactions.size();
charges.size();
savingsOfficerHistory.size();
if(group != null) { Office dummyOffice = group.getOffice(); } // Ensure lazy loading of group if set
}

public void updateSavingsAccountSummary(final List<SavingsAccountTransaction> transactions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public interface SavingsAccountChargeRepository extends JpaRepository<SavingsAcc
JpaSpecificationExecutor<SavingsAccountCharge> {

@Query("select sac from SavingsAccountCharge sac where sac.id =:id and sac.savingsAccount.id = :savingsAccountId")
SavingsAccountCharge findByIdAndSavingsAccountId(Long id, Long savingsAccountId);
SavingsAccountCharge findByIdAndSavingsAccountId(@Param("id") Long id, @Param("savingsAccountId") Long savingsAccountId);

@Query("select sac from SavingsAccountCharge sac where sac.dueDate <=:transactionDate and sac.waived = 0 and sac.paid=0 order by sac.dueDate")
List<SavingsAccountCharge> findPendingCharges(@Param("transactionDate") Date transactionDate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public void applyAnnualFeeForSavings() {
LOG.error("Apply annual fee failed for account: {} with message {}", savingsAccountReference.getAccountNo(), error);
}
} catch (final Exception ex) {
// need to handle this scenario
LOG.error("Apply annual fee failed for account: {}", savingsAccountReference.getAccountNo(), ex);
}
}

Expand All @@ -250,6 +250,9 @@ public void applyDueChargesForSavings() throws JobExecutionException {
for (final ApiParameterError error : errors) {
LOG.error("Apply Charges due for savings failed for account {} with message: {}", savingsAccountReference.getAccountNo(), error.getDeveloperMessage(), e);
}
} catch (final Exception ex) {
exceptions.add(ex);
LOG.error("Apply Charges due for savings failed for account: {}", savingsAccountReference.getAccountNo(), ex);
}
}
LOG.info("{}: Savings accounts affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), chargesDueData.size());
Expand Down Expand Up @@ -307,7 +310,7 @@ public void updateMaturityDetailsOfDepositAccounts() {
LOG.error("Update maturity details failed for account: {} with message {}", depositAccount.accountNo(), error.getDeveloperMessage());
}
} catch (final Exception ex) {
// need to handle this scenario
LOG.error("Update maturity details failed for account: {}", depositAccount.accountNo(), ex);
}
}

Expand Down