in component-test/src/main/java/org/apache/fineract/cn/portfolio/TestAccountingInteractionInLoanWorkflow.java [928:958]
private void step6CalculateInterestAndCheckForLatenessForRangeOfDays(
final LocalDateTime referenceDate,
final int startInclusive,
final int endInclusive,
final int relativeDayOfLateFee,
final BigDecimal calculatedLateFee) throws InterruptedException {
try {
final LocalDateTime absoluteDayOfLateFee = referenceDate.plusDays(startInclusive + relativeDayOfLateFee);
IntStream.rangeClosed(startInclusive, endInclusive)
.mapToObj(referenceDate::plusDays)
.forEach(day -> {
try {
if (day.equals(absoluteDayOfLateFee)) {
step6CalculateInterestAccrualAndCheckForLateness(day, calculatedLateFee);
}
else {
step6CalculateInterestAccrualAndCheckForLateness(day, BigDecimal.ZERO);
}
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
});
}
catch (RuntimeException e) {
final Throwable cause = e.getCause();
if (cause != null && cause.getClass().isAssignableFrom(InterruptedException.class))
throw (InterruptedException)e.getCause();
else
throw e;
}
}