File tree Expand file tree Collapse file tree
ext-test/java/org/opentripplanner/ext/stopconsolidation
main/java/org/opentripplanner/transit/model/network
test/java/org/opentripplanner
routing/algorithm/mapping Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package org .opentripplanner .ext .stopconsolidation ;
22
3- import static org .opentripplanner .transit .model ._data .TimetableRepositoryForTest .id ;
4-
53import java .util .List ;
64import org .opentripplanner .transit .model ._data .TimetableRepositoryForTest ;
75import org .opentripplanner .transit .model .framework .Deduplicator ;
@@ -39,7 +37,7 @@ class TestStopConsolidationModel {
3937 .withId (new FeedScopedId (SECONDARY_FEED_ID , "secondary-stop-D" ))
4038 .build ();
4139
42- static final TripPattern PATTERN = TripPattern .of (id ( "123" ))
40+ static final TripPattern PATTERN = TripPattern .of (new FeedScopedId ( SECONDARY_FEED_ID , "123" ))
4341 .withRoute (ROUTE )
4442 .withStopPattern (STOP_PATTERN )
4543 .build ();
Original file line number Diff line number Diff line change @@ -142,6 +142,8 @@ public final class TripPattern
142142
143143 this .hopGeometries = builder .hopGeometries ();
144144 this .routingTripPattern = new RoutingTripPattern (this );
145+
146+ getId ().requireSameFeedId (route .getId ());
145147 }
146148
147149 public static TripPatternBuilder of (FeedScopedId id ) {
@@ -445,7 +447,7 @@ public TripPattern clone() {
445447 */
446448 public String getFeedId () {
447449 // The feed id is the same as the agency id on the route, this allows us to obtain it from there.
448- return route . getId ().getFeedId ();
450+ return getId ().getFeedId ();
449451 }
450452
451453 public RoutingTripPattern getRoutingTripPattern () {
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ public TripPattern setupTripPattern(
105105 var stopPattern = builder .build ();
106106 var route = TimetableRepositoryForTest .route ("R1" ).build ();
107107
108- return TripPattern .of (new FeedScopedId ("Test" , "T1" ))
108+ return TripPattern .of (new FeedScopedId (route . getId (). getFeedId () , "T1" ))
109109 .withRoute (route )
110110 .withStopPattern (stopPattern )
111111 .withOriginalTripPattern (originalTripPattern )
Original file line number Diff line number Diff line change @@ -282,7 +282,7 @@ private TripPattern getOriginalPattern(TestTripPattern pattern) {
282282 stopTimes .add (stopTime );
283283 }
284284
285- var builder = TripPattern .of (new FeedScopedId ("TestFeed" , "TestId" ))
285+ var builder = TripPattern .of (new FeedScopedId (pattern . route (). getId (). getFeedId () , "TestId" ))
286286 .withRoute (pattern .route ())
287287 .withStopPattern (new StopPattern (stopTimes ));
288288 return builder .build ();
You can’t perform that action at this time.
0 commit comments