Skip to content

Commit

Permalink
[Fix_3818] Wrong calculation in test rollCalendarAfterHolidays if day is
Browse files Browse the repository at this point in the history
near to end-of-year
  • Loading branch information
gmunozfe committed Dec 30, 2024
1 parent 3ecc10d commit 815e8c7
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,12 @@ void rollCalendarAfterHolidays() {
List<Integer> weekendDays = Collections.emptyList();
Calendar calendar = Calendar.getInstance();
int currentDayOfYear = calendar.get(Calendar.DAY_OF_YEAR);
int maxDaysInYear = calendar.getActualMaximum(Calendar.DAY_OF_YEAR);
BusinessCalendarImpl.rollCalendarAfterHolidays(calendar, holidays, weekendDays, false);
int expected = currentDayOfYear + holidayLeft + 1;
if (expected > maxDaysInYear) {
expected -= maxDaysInYear;
}
assertThat(calendar.get(Calendar.DAY_OF_YEAR)).isEqualTo(expected);
}

Expand Down

0 comments on commit 815e8c7

Please sign in to comment.