Skip to content

Commit e6578c0

Browse files
committed
Use custom test stops with distinct coordinates
1 parent 824d62b commit e6578c0

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

application/src/test/java/org/opentripplanner/model/plan/leg/ScheduledTransitLegTest.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,15 @@ class ScheduledTransitLegTest {
3737
).toZonedDateTime();
3838
private static final ZonedDateTime END_TIME = START_TIME.plusMinutes(10);
3939
private static final TransitTestEnvironmentBuilder ENV_BUILDER = TransitTestEnvironment.of();
40-
private static final RegularStop STOP_0 = ENV_BUILDER.stop("Stop_0");
41-
private static final RegularStop STOP_1 = ENV_BUILDER.stop("Stop_1");
42-
private static final RegularStop STOP_2 = ENV_BUILDER.stop("Stop_2");
40+
private static final RegularStop STOP_0 = ENV_BUILDER.stop("Stop_0", b ->
41+
b.withCoordinate(60.0, 10.0)
42+
);
43+
private static final RegularStop STOP_1 = ENV_BUILDER.stop("Stop_1", b ->
44+
b.withCoordinate(60.0, 10.01)
45+
);
46+
private static final RegularStop STOP_2 = ENV_BUILDER.stop("Stop_2", b ->
47+
b.withCoordinate(60.0, 10.02)
48+
);
4349
private static final TransitTestEnvironment ENV = ENV_BUILDER.addTrip(
4450
TripInput.of("trip1")
4551
.addStop(STOP_0, "10:00", "10:01")
@@ -177,7 +183,7 @@ void testToString() {
177183
assertEquals(
178184
"ScheduledTransitLeg{" +
179185
"from: Place{name: Stop_0, stop: RegularStop{F:Stop_0 Stop_0}, coordinate: (60.0, 10.0), vertexType: TRANSIT, viaLocationType: PASS_THROUGH}, " +
180-
"to: Place{name: Stop_2, stop: RegularStop{F:Stop_2 Stop_2}, coordinate: (60.0, 10.0), vertexType: TRANSIT, viaLocationType: VISIT}, " +
186+
"to: Place{name: Stop_2, stop: RegularStop{F:Stop_2 Stop_2}, coordinate: (60.0, 10.02), vertexType: TRANSIT, viaLocationType: VISIT}, " +
181187
"startTime: 2023-04-17T17:49:06, " +
182188
"endTime: 2023-04-17T17:59:06, " +
183189
"realTime: true, " +

0 commit comments

Comments
 (0)