Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Jan 17, 2025
1 parent 254566f commit 59bf199
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.opentripplanner.framework.application.OtpFileNames.BUILD_CONFIG_FILENAME;
import static org.opentripplanner.transit.model._data.TimetableRepositoryForTest.id;

import java.util.Map;
import org.junit.jupiter.api.Test;
import org.opentripplanner.ConstantsForTests;
import org.opentripplanner._support.time.ZoneIds;
Expand All @@ -12,8 +14,10 @@
import org.opentripplanner.model.Timetable;
import org.opentripplanner.routing.graph.Graph;
import org.opentripplanner.test.support.ResourceLoader;
import org.opentripplanner.transit.model._data.TimetableRepositoryForTest;
import org.opentripplanner.transit.model.framework.Deduplicator;
import org.opentripplanner.transit.model.framework.FeedScopedId;
import org.opentripplanner.transit.model.site.RegularStop;
import org.opentripplanner.transit.model.timetable.Trip;

class TimetableRepositoryTest {
Expand Down Expand Up @@ -107,4 +111,13 @@ void validateTimeZonesWithExplicitTimeZone() {
Timetable timetable = timetableRepositoryIndex.getPatternForTrip(trip).getScheduledTimetable();
assertEquals(20 * 60 - 60 * 60, timetable.getTripTimes(trip).getDepartureTime(0));
}

@Test
void scheduledStopPoints() {
var repo = new TimetableRepository();
var sspId = id("ssp-1");
var stop = TimetableRepositoryForTest.of().stop("stop-1").build();
repo.addScheduledStopPointMapping(Map.of(sspId, stop));
assertEquals(stop, repo.findStopByScheduledStopPoint(sspId).get());
}
}

0 comments on commit 59bf199

Please sign in to comment.