Skip to content

Commit 1bdabf6

Browse files
committed
reinstate removed test getTripTimesOnNoServireDay and add a test for the corresponding case with useScheduledWhenNonRunning
1 parent 900fde1 commit 1bdabf6

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

application/src/test/java/org/opentripplanner/transit/service/DefaultTransitServiceTest.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,28 @@ void getRealtimeTripTimes() {
249249
);
250250
}
251251

252+
@Test
253+
void getTripTimesOnNoServiceDayWithUseScheduleOption() {
254+
Instant midnight = ServiceDateUtils
255+
.asStartOfService(SERVICE_DATE, service.getTimeZone())
256+
.toInstant();
257+
258+
assertEquals(
259+
Optional.of(
260+
List.of(
261+
new TripTimeOnDate(REALTIME_TRIP_TIMES, 0, REAL_TIME_PATTERN, SERVICE_DATE, midnight),
262+
new TripTimeOnDate(REALTIME_TRIP_TIMES, 1, REAL_TIME_PATTERN, SERVICE_DATE, midnight)
263+
)
264+
),
265+
service.getTripTimeOnDates(TRIP, SERVICE_DATE, true)
266+
);
267+
}
268+
269+
@Test
270+
void getTripTimesOnNoServiceDay() {
271+
assertEquals(Optional.empty(), service.getTripTimeOnDates(TRIP, NO_SERVICE_DATE));
272+
}
273+
252274
@Test
253275
void getScheduledTripTimesForAddedTrip() {
254276
assertEquals(Optional.empty(), service.getScheduledTripTimes(ADDED_TRIP));

0 commit comments

Comments
 (0)