Skip to content

Commit

Permalink
Fix arrive by snapshot test
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Sep 6, 2024
1 parent 34c2601 commit 8a96f3a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/main/java/org/opentripplanner/model/plan/Itinerary.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ public boolean isOnStreetAllTheWay() {
return isStreetOnly();
}

/**
* Does this itinerary contain only street or flex legs?
*/
public boolean isOnStreetAndFlexOnly() {
return legs.stream().allMatch(l -> l.isStreetLeg() || l.isFlexibleTrip());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ public void setTimetableView(boolean timetableView) {
/**
* Whether the trip should depart at dateTime (false, the default), or arrive at dateTime.
*/
@Deprecated
public boolean arriveBy() {
return arriveBy;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.opentripplanner.model.plan.TestItineraryBuilder;
import org.opentripplanner.routing.api.request.SearchDirection;

public class OutsideSearchWindowFilterTest implements PlanTestConstants {
class OutsideSearchWindowFilterTest implements PlanTestConstants {

private static final Duration SEARCH_WINDOW_10m = Duration.ofMinutes(10);
private final int startTime = TimeUtils.time("09:30");
Expand All @@ -38,7 +38,7 @@ static List<Arguments> filterOnSearchWindowTestCases() {

@ParameterizedTest(name = "{0}, edt: {1}, sw: 10m, expects flagged for removal: {2}")
@MethodSource("filterOnSearchWindowTestCases")
public void filterOnSearchWindow(String description, String edt, boolean flaggedForRemoval) {
void filterOnSearchWindow(String description, String edt, boolean flaggedForRemoval) {
List<Itinerary> expected = flaggedForRemoval ? input : List.of();
var subject = new OutsideSearchWindowFilter(
TestItineraryBuilder.newTime(TimeUtils.time(edt)).toInstant(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public void test_trip_planning_with_transit_stop() {
request.setFrom(ps);
request.setTo(p3);

expectArriveByToMatchDepartAtAndSnapshot(request);
expectRequestResponseToMatchSnapshot(request);
}

@Test
Expand Down

0 comments on commit 8a96f3a

Please sign in to comment.