File tree Expand file tree Collapse file tree
ext-test/java/org/opentripplanner/ext/stopconsolidation/model
main/java/org/opentripplanner/model/plan/leg
test/java/org/opentripplanner/raptorlegacy/_data/transit Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import static org .opentripplanner .transit .model ._data .TimetableRepositoryForTest .id ;
66
77import java .time .LocalDate ;
8+ import java .time .ZonedDateTime ;
89import java .util .List ;
910import java .util .Set ;
1011import org .junit .jupiter .api .Test ;
2122
2223class ConsolidatedStopLegBuilderTest implements PlanTestConstants {
2324
25+ private static final ZonedDateTime TIME = ZonedDateTime .parse ("2025-06-25T08:33:36+02:00" );
2426 private static final Set <TransitAlert > ALERTS = Set .of (
2527 TransitAlert .of (id ("alert" )).withDescriptionText (I18NString .of ("alert" )).build ()
2628 );
@@ -30,11 +32,13 @@ class ConsolidatedStopLegBuilderTest implements PlanTestConstants {
3032 private static final ScheduledTransitLeg SCHEDULED_TRANSIT_LEG =
3133 new ScheduledTransitLegBuilder <>()
3234 .withZoneId (ZoneIds .BERLIN )
33- .withServiceDate (LocalDate .of (2025 , 1 , 15 ))
3435 .withTripPattern (PATTERN )
3536 .withBoardStopIndexInPattern (0 )
3637 .withDistanceMeters (1000 )
3738 .withAlightStopIndexInPattern (1 )
39+ .withStartTime (TIME )
40+ .withEndTime (TIME )
41+ .withServiceDate (TIME .toLocalDate ())
3842 .build ();
3943 private static final List <FareProductUse > FARES = List .of (FARE_PRODUCT_USE );
4044
Original file line number Diff line number Diff line change @@ -94,16 +94,9 @@ protected ScheduledTransitLeg(ScheduledTransitLegBuilder<?> builder) {
9494 "alightStopPosInPattern"
9595 );
9696
97- // TODO - Add requireNonNull for start-time. Some tests fails when this is done, these tests
98- // should be fixed.
99- this .startTime = builder .startTime ();
100- // TODO - Add requireNonNull for end-tTime. Some tests fails when this is done, these tests
101- // should be fixed.
102- this .endTime = builder .endTime ();
103-
104- // TODO - Add requireNonNull for service-date. Some tests fails when this is done, these tests
105- // should be fixed.
106- this .serviceDate = builder .serviceDate ();
97+ this .startTime = Objects .requireNonNull (builder .startTime ());
98+ this .endTime = Objects .requireNonNull (builder .endTime ());
99+ this .serviceDate = Objects .requireNonNull (builder .serviceDate ());
107100 this .zoneId = Objects .requireNonNull (builder .zoneId ());
108101
109102 this .tripOnServiceDate = builder .tripOnServiceDate ();
Original file line number Diff line number Diff line change 2525public class TestTripSchedule implements TripSchedule {
2626
2727 private static final int DEFAULT_DEPARTURE_DELAY = 10 ;
28+ private static final LocalDate DATE = LocalDate .of (2025 , 6 , 25 );
2829 private final DefaultTripPattern pattern ;
2930 private final int [] arrivalTimes ;
3031 private final int [] departureTimes ;
@@ -113,7 +114,7 @@ public String toString() {
113114
114115 @ Override
115116 public LocalDate getServiceDate () {
116- return null ;
117+ return DATE ;
117118 }
118119
119120 @ Override
You can’t perform that action at this time.
0 commit comments