File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed
main/java/org/opentripplanner Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -606,12 +606,12 @@ private boolean clearEntriesForRealtimeAddedTrips(String feedId) {
606606 }
607607
608608 /**
609- * Add the patterns to the stop index, only if they come from a modified pattern
609+ * Add patterns to the stop index for patterns created by realtime updaters.
610+ * This ensures that realtime-added trips (like SIRI ET ExtraJourneys) appear in
611+ * departure board queries at stops.
610612 */
611613 private void addPatternToIndex (TripPattern tripPattern ) {
612614 if (tripPattern .isCreatedByRealtimeUpdater ()) {
613- //TODO - SIRI: Add pattern to index?
614-
615615 for (var stop : tripPattern .getStops ()) {
616616 patternsForStop .put (stop , tripPattern );
617617 }
Original file line number Diff line number Diff line change @@ -233,6 +233,7 @@ Result<TripUpdate, UpdateError> build() {
233233 .withNetexSubmode (trip .getNetexSubMode ())
234234 .withStopPattern (stopPattern )
235235 .withScheduledTimeTableBuilder (builder -> builder .addTripTimes (tripTimes ))
236+ .withCreatedByRealtimeUpdater (true )
236237 .build ();
237238
238239 RealTimeTripTimesBuilder builder = tripTimes .createRealTimeFromScheduledTimes ();
Original file line number Diff line number Diff line change 22
33import static org .junit .jupiter .api .Assertions .assertEquals ;
44import static org .junit .jupiter .api .Assertions .assertNotNull ;
5+ import static org .junit .jupiter .api .Assertions .assertTrue ;
56import static org .opentripplanner .transit .model ._data .FeedScopedIdForTestFactory .id ;
67import static org .opentripplanner .updater .spi .UpdateResultAssertions .assertFailure ;
78
@@ -79,6 +80,20 @@ void testAddJourneyWithExistingRoute() {
7980 transitService .findPatterns (route ).size (),
8081 "The added trip should use a new pattern for this route"
8182 );
83+
84+ // Verify ExtraJourney appears in departure board (#7008)
85+ var expectedPattern = transitService .findPattern (trip );
86+ var patternsAtStopC = transitService .findPatterns (STOP_C , true );
87+ assertTrue (
88+ patternsAtStopC .contains (expectedPattern ),
89+ "ExtraJourney pattern should appear in patterns for stop C (departure board)"
90+ );
91+
92+ var patternsAtStopD = transitService .findPatterns (STOP_D , true );
93+ assertTrue (
94+ patternsAtStopD .contains (expectedPattern ),
95+ "ExtraJourney pattern should appear in patterns for stop D (arrival board)"
96+ );
8297 }
8398
8499 @ Test
You can’t perform that action at this time.
0 commit comments