[FINERACT-1678] Exclude loan IDs from execution context

This commit is contained in:
taskain7
2023-04-13 10:36:19 +02:00
committed by Adam Saghy
parent fbd0bb91c0
commit 6eba33758b
10 changed files with 35 additions and 39 deletions
@@ -71,7 +71,7 @@ public class ApplyLoanLockTaskletStepDefinitions implements En {
StepExecution stepExecution = new StepExecution("test", null);
ExecutionContext executionContext = new ExecutionContext();
executionContext.put(LoanCOBConstant.LOAN_COB_PARAMETER, new LoanCOBParameter(1L, 4L));
lenient().when(this.loanRepository.findAllNonClosedLoansBehindOrNullByMinAndMaxLoanId(anyLong(), anyLong(), any()))
lenient().when(this.loanRepository.findAllNonClosedLoansByLastClosedBusinessDateAndMinAndMaxLoanId(anyLong(), anyLong(), any()))
.thenReturn(List.of(1L, 2L, 3L, 4L));
stepExecution.setExecutionContext(executionContext);
this.stepContribution = new StepContribution(stepExecution);
@@ -128,7 +128,8 @@ public class LoanCOBPartitionerStepDefinitions implements En {
businessSteps.stream().findFirst().get().getStepName());
LoanCOBParameter loanCOBParameter = (LoanCOBParameter) resultItem.get(LoanCOBPartitioner.PARTITION_PREFIX + "1")
.get(LoanCOBConstant.LOAN_COB_PARAMETER);
assertEquals(null, loanCOBParameter);
assertEquals(0L, loanCOBParameter.getMinLoanId());
assertEquals(0L, loanCOBParameter.getMaxLoanId());
}
});
}
@@ -71,9 +71,9 @@ public class LoanItemReaderStepDefinitions implements En {
maxLoanId = splitAccounts.get(splitAccounts.size() - 1);
}
stepExecutionContext.put(LoanCOBConstant.LOAN_COB_PARAMETER, new LoanCOBParameter(minLoanId, maxLoanId));
jobExecution.setExecutionContext(stepExecutionContext);
stepExecution.setExecutionContext(stepExecutionContext);
lenient().when(this.loanRepository.findAllNonClosedLoansBehindOrNullByMinAndMaxLoanId(anyLong(), anyLong(), any()))
lenient().when(this.loanRepository.findAllNonClosedLoansByLastClosedBusinessDateAndMinAndMaxLoanId(anyLong(), anyLong(), any()))
.thenReturn(splitAccounts);
HashMap<BusinessDateType, LocalDate> businessDates = new HashMap<>();