FINERACT-1724 - Loan CatchUp fix
- [x] Update null loan cob date when hard lock - [x] Update hard lock to soft lock - [x] Ignore null loan cob date when catch up
This commit is contained in:
+2
-1
@@ -66,7 +66,8 @@ public class ApplyLoanLockTaskletStepDefinitions implements En {
|
||||
ExecutionContext executionContext = new ExecutionContext();
|
||||
LoanCOBParameter loanCOBParameter = new LoanCOBParameter(1L, 4L);
|
||||
executionContext.put(LoanCOBConstant.LOAN_COB_PARAMETER, loanCOBParameter);
|
||||
lenient().when(retrieveLoanIdService.retrieveAllNonClosedLoansByLastClosedBusinessDateAndMinAndMaxLoanId(loanCOBParameter))
|
||||
lenient().when(
|
||||
retrieveLoanIdService.retrieveAllNonClosedLoansByLastClosedBusinessDateAndMinAndMaxLoanId(loanCOBParameter, false))
|
||||
.thenReturn(List.of(1L, 2L, 3L, 4L));
|
||||
stepExecution.setExecutionContext(executionContext);
|
||||
stepContribution = new StepContribution(stepExecution);
|
||||
|
||||
+14
-4
@@ -53,6 +53,8 @@ public class FetchAndLockLoanStepDefinitions implements En {
|
||||
StepContribution contribution;
|
||||
ArgumentCaptor<LocalDate> dateValueCaptor = ArgumentCaptor.forClass(LocalDate.class);
|
||||
ArgumentCaptor<LoanCOBParameter> loanCOBParameterValueCaptor = ArgumentCaptor.forClass(LoanCOBParameter.class);
|
||||
|
||||
ArgumentCaptor<Boolean> isCatchUpParameterCaptor = ArgumentCaptor.forClass(Boolean.class);
|
||||
private LockLoanTasklet lockLoanTasklet;
|
||||
private String action;
|
||||
private RepeatStatus result;
|
||||
@@ -115,44 +117,52 @@ public class FetchAndLockLoanStepDefinitions implements En {
|
||||
if ("empty steps".equals(action)) {
|
||||
assertEquals(RepeatStatus.FINISHED, result);
|
||||
} else if ("good".equals(action)) {
|
||||
verify(loanLockingService).applySoftLock(dateValueCaptor.capture(), loanCOBParameterValueCaptor.capture());
|
||||
verify(loanLockingService).applySoftLock(dateValueCaptor.capture(), loanCOBParameterValueCaptor.capture(),
|
||||
isCatchUpParameterCaptor.capture());
|
||||
assertEquals(LocalDate.now(ZoneId.systemDefault()).minusDays(1), dateValueCaptor.getValue());
|
||||
assertEquals(1L, loanCOBParameterValueCaptor.getValue().getMinLoanId());
|
||||
assertEquals(3L, loanCOBParameterValueCaptor.getValue().getMaxLoanId());
|
||||
assertEquals(RepeatStatus.FINISHED, result);
|
||||
assertEquals(false, isCatchUpParameterCaptor.getValue());
|
||||
LoanCOBParameter loanCOBParameter = (LoanCOBParameter) contribution.getStepExecution().getJobExecution()
|
||||
.getExecutionContext().get(LoanCOBConstant.LOAN_COB_PARAMETER);
|
||||
assertEquals(2, loanCOBParameter.getMaxLoanId() - loanCOBParameter.getMinLoanId());
|
||||
assertEquals(1L, loanCOBParameter.getMinLoanId());
|
||||
assertEquals(3L, loanCOBParameter.getMaxLoanId());
|
||||
} else if ("soft lock".equals(action)) {
|
||||
verify(loanLockingService).applySoftLock(dateValueCaptor.capture(), loanCOBParameterValueCaptor.capture());
|
||||
verify(loanLockingService).applySoftLock(dateValueCaptor.capture(), loanCOBParameterValueCaptor.capture(),
|
||||
isCatchUpParameterCaptor.capture());
|
||||
assertEquals(LocalDate.now(ZoneId.systemDefault()).minusDays(1), dateValueCaptor.getValue());
|
||||
assertEquals(1L, loanCOBParameterValueCaptor.getValue().getMinLoanId());
|
||||
assertEquals(3L, loanCOBParameterValueCaptor.getValue().getMaxLoanId());
|
||||
assertEquals(RepeatStatus.FINISHED, result);
|
||||
assertEquals(false, isCatchUpParameterCaptor.getValue());
|
||||
LoanCOBParameter loanCOBParameter = (LoanCOBParameter) contribution.getStepExecution().getJobExecution()
|
||||
.getExecutionContext().get(LoanCOBConstant.LOAN_COB_PARAMETER);
|
||||
assertEquals(2, loanCOBParameter.getMaxLoanId() - loanCOBParameter.getMinLoanId());
|
||||
assertEquals(1L, loanCOBParameter.getMinLoanId());
|
||||
assertEquals(3L, loanCOBParameter.getMaxLoanId());
|
||||
} else if ("inline cob".equals(action)) {
|
||||
verify(loanLockingService).applySoftLock(dateValueCaptor.capture(), loanCOBParameterValueCaptor.capture());
|
||||
verify(loanLockingService).applySoftLock(dateValueCaptor.capture(), loanCOBParameterValueCaptor.capture(),
|
||||
isCatchUpParameterCaptor.capture());
|
||||
assertEquals(LocalDate.now(ZoneId.systemDefault()).minusDays(1), dateValueCaptor.getValue());
|
||||
assertEquals(1L, loanCOBParameterValueCaptor.getValue().getMinLoanId());
|
||||
assertEquals(3L, loanCOBParameterValueCaptor.getValue().getMaxLoanId());
|
||||
assertEquals(RepeatStatus.FINISHED, result);
|
||||
assertEquals(false, isCatchUpParameterCaptor.getValue());
|
||||
LoanCOBParameter loanCOBParameter = (LoanCOBParameter) contribution.getStepExecution().getJobExecution()
|
||||
.getExecutionContext().get(LoanCOBConstant.LOAN_COB_PARAMETER);
|
||||
assertEquals(2, loanCOBParameter.getMaxLoanId() - loanCOBParameter.getMinLoanId());
|
||||
assertEquals(1L, loanCOBParameter.getMinLoanId());
|
||||
assertEquals(3L, loanCOBParameter.getMaxLoanId());
|
||||
} else if ("chunk processing".equals(action)) {
|
||||
verify(loanLockingService).applySoftLock(dateValueCaptor.capture(), loanCOBParameterValueCaptor.capture());
|
||||
verify(loanLockingService).applySoftLock(dateValueCaptor.capture(), loanCOBParameterValueCaptor.capture(),
|
||||
isCatchUpParameterCaptor.capture());
|
||||
assertEquals(LocalDate.now(ZoneId.systemDefault()).minusDays(1), dateValueCaptor.getValue());
|
||||
assertEquals(1L, loanCOBParameterValueCaptor.getValue().getMinLoanId());
|
||||
assertEquals(3L, loanCOBParameterValueCaptor.getValue().getMaxLoanId());
|
||||
assertEquals(RepeatStatus.FINISHED, result);
|
||||
assertEquals(false, isCatchUpParameterCaptor.getValue());
|
||||
LoanCOBParameter loanCOBParameter = (LoanCOBParameter) contribution.getStepExecution().getJobExecution()
|
||||
.getExecutionContext().get(LoanCOBConstant.LOAN_COB_PARAMETER);
|
||||
assertEquals(2, loanCOBParameter.getMaxLoanId() - loanCOBParameter.getMinLoanId());
|
||||
|
||||
+2
-1
@@ -74,7 +74,8 @@ public class LoanItemReaderStepDefinitions implements En {
|
||||
stepExecutionContext.put(LoanCOBConstant.LOAN_COB_PARAMETER, loanCOBParameter);
|
||||
stepExecution.setExecutionContext(stepExecutionContext);
|
||||
|
||||
lenient().when(this.retrieveLoanIdService.retrieveAllNonClosedLoansByLastClosedBusinessDateAndMinAndMaxLoanId(loanCOBParameter))
|
||||
lenient().when(
|
||||
this.retrieveLoanIdService.retrieveAllNonClosedLoansByLastClosedBusinessDateAndMinAndMaxLoanId(loanCOBParameter, false))
|
||||
.thenReturn(splitAccounts);
|
||||
|
||||
HashMap<BusinessDateType, LocalDate> businessDates = new HashMap<>();
|
||||
|
||||
Reference in New Issue
Block a user