Skip to content

Commit

Permalink
Remove method only used in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Sep 10, 2024
1 parent 5ba8d94 commit 19cba76
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.opentripplanner.routing.api.request.StreetMode.FLEXIBLE;
import static org.opentripplanner.street.search.TraverseMode.WALK;
Expand Down Expand Up @@ -96,7 +97,7 @@ void shouldReturnARouteTransferringFromBusToFlex() {
var flex = itin.getTransitLeg(3);
assertEquals(BUS, flex.getMode());
assertEquals("Zone 2", flex.getRoute().getShortName());
assertTrue(flex.isFlexibleTrip());
assertInstanceOf(FlexibleTransitLeg.class, flex);
assertEquals(
"corner of Story Place Southwest and service road (part of Flex Zone 2)",
flex.getFrom().name.toString()
Expand Down Expand Up @@ -132,7 +133,7 @@ void shouldReturnARouteWithTwoTransfers() {
var finalFlex = itin.getTransitLeg(4);
assertEquals(BUS, finalFlex.getMode());
assertEquals("Zone 2", finalFlex.getRoute().getShortName());
assertTrue(finalFlex.isFlexibleTrip());
assertInstanceOf(FlexibleTransitLeg.class, finalFlex);
assertEquals("2021-12-02T15:00-05:00[America/New_York]", finalFlex.getStartTime().toString());
assertEquals("2021-12-02T15:30-05:00[America/New_York]", finalFlex.getEndTime().toString());
}
Expand All @@ -151,7 +152,7 @@ void flexDirect() {
"Should contain only flex itineraries"
);

var itin = itineraries.get(0);
var itin = itineraries.getFirst();

// walk, flex
assertEquals(2, itin.getLegs().size());
Expand All @@ -164,7 +165,7 @@ void flexDirect() {
var flex = itin.getTransitLeg(1);
assertEquals(BUS, flex.getMode());
assertEquals("Zone 2", flex.getRoute().getShortName());
assertTrue(flex.isFlexibleTrip());
assertInstanceOf(FlexibleTransitLeg.class, flex);

assertEquals("Transfer Point for Route 30", flex.getFrom().name.toString());
assertEquals("Destination (part of Flex Zone 2)", flex.getTo().name.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,6 @@ public ZonedDateTime getEndTime() {
return endTime;
}

@Override
public boolean isFlexibleTrip() {
return true;
}

@Override
public double getDistanceMeters() {
return DoubleUtils.roundTo2Decimals(edge.getDistanceMeters());
Expand Down
9 changes: 0 additions & 9 deletions src/main/java/org/opentripplanner/model/plan/Leg.java
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,6 @@ default boolean getRealTime() {
return false;
}

/**
* Whether this Leg describes a flexible trip. The reason we need this is that FlexTrip does not
* inherit from Trip, so that the information that the Trip is flexible would be lost when
* creating this object.
*/
default boolean isFlexibleTrip() {
return false;
}

/**
* Is this a frequency-based trip with non-strict departure times?
*/
Expand Down

0 comments on commit 19cba76

Please sign in to comment.