adamsaghy commented on code in PR #2778:
URL: https://github.com/apache/fineract/pull/2778#discussion_r1034968902
##########
fineract-provider/src/test/java/org/apache/fineract/cob/common/InitialisationTaskletStepDefinitions.java:
##########
@@ -48,11 +59,22 @@ public InitialisationTaskletStepDefinitions() {
} else {
lenient().when(this.userRepository.fetchSystemUser()).thenReturn(appUser);
}
-
+ HashMap<BusinessDateType, LocalDate> businessDates = new
HashMap<>();
+ LocalDate businessDate = LocalDate.now(ZoneId.systemDefault());
+ LocalDate cobBusinessDate = businessDate.minusDays(1);
+ businessDates.put(BusinessDateType.BUSINESS_DATE, businessDate);
+ businessDates.put(BusinessDateType.COB_DATE, cobBusinessDate);
+ ThreadLocalContextUtil.setBusinessDates(businessDates);
+ JobExecution jobExecution = new JobExecution(1L);
+
jobExecution.getExecutionContext().put(LoanCOBConstant.BUSINESS_DATE_PARAMETER_NAME,
+ cobBusinessDate.format(DateTimeFormatter.ISO_DATE));
+ StepExecution stepExecution = new StepExecution("step",
jobExecution);
+ StepContext stepContext = new StepContext(stepExecution);
+ chunkContext = new ChunkContext(stepContext);
});
When("InitialisationTasklet.execute method executed", () -> {
- resultItem = this.initialisationTasklet.execute(null, null);
+ resultItem = this.initialisationTasklet.execute(null,
chunkContext);
Review Comment:
Could you please enhanced this test to check whether the proper dates were
provided and set?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]