Skip to content

Commit

Permalink
Fix getOpeningDayDurationTest
Browse files Browse the repository at this point in the history
When the test execution happens in the time range 00:00-00:59
the test fails because hour 0 minus one hour yields hour 23.

Fix: Hard-code the local time.
  • Loading branch information
julianladisch committed Nov 5, 2023
1 parent 9fc88f6 commit 331fd94
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,13 @@ private static Object[] getOpeningDayDurationTestParameters() {
createOpeningDay(true, LocalDate.parse("2020-04-09"), LONDON),
createOpeningDay(false, LocalDate.parse("2020-04-10"), LONDON));

LocalTime now = getLocalTime();

List<OpeningDay> invalid = Arrays.asList(
new OpeningDay(
singletonList(new OpeningHour(null, null)), LocalDate.parse("2020-04-08"), false, true, UTC
),
new OpeningDay(
singletonList(new OpeningHour(now, now.minusHours(1))), LocalDate.parse("2020-04-09"),
false, true, UTC)
new OpeningDay( // startTime after endTime
singletonList(new OpeningHour(LocalTime.of(6, 0), LocalTime.of(5, 0))),
LocalDate.parse("2020-04-09"), false, true, UTC)
);

List<OpeningDay> allDaysClosed = Arrays.asList(
Expand Down

0 comments on commit 331fd94

Please sign in to comment.