Skip to content

Commit 22f8440

Browse files
Fine-tune tests
1 parent 992f031 commit 22f8440

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

application/src/ext-test/java/org/opentripplanner/ext/fares/impl/gtfs/TimeLimitEvaluatorTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ void withinLimit(TimeLimitType type, Duration duration) {
5151

5252
private static List<Arguments> belowLimitCases() {
5353
return List.of(
54-
Arguments.of(DEPARTURE_TO_ARRIVAL, ofMinutes(19)),
54+
Arguments.of(DEPARTURE_TO_ARRIVAL, ofMinutes(20).minusSeconds(20)),
5555
Arguments.of(DEPARTURE_TO_DEPARTURE, ofMinutes(10).minusSeconds(1)),
5656
Arguments.of(ARRIVAL_TO_ARRIVAL, ofMinutes(15).minusSeconds(1)),
57-
Arguments.of(ARRIVAL_TO_DEPARTURE, ofMinutes(4))
57+
Arguments.of(ARRIVAL_TO_DEPARTURE, ofMinutes(5).minusSeconds(1))
5858
);
5959
}
6060

application/src/ext/java/org/opentripplanner/ext/fares/model/TimeLimitType.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ public enum TimeLimitType {
1515
*/
1616
DEPARTURE_TO_DEPARTURE,
1717
/**
18-
* The duration is to be computed from the arrival time of the current leg to the arrival time of
18+
* The duration is to be computed from the arrival time of the current leg to the departure time of
1919
* the next one.
2020
*/
21-
ARRIVAL_TO_ARRIVAL,
21+
ARRIVAL_TO_DEPARTURE,
2222
/**
23-
* The duration is to be computed from the arrival time of the current leg to the departure time of
23+
* The duration is to be computed from the arrival time of the current leg to the arrival time of
2424
* the next one.
2525
*/
26-
ARRIVAL_TO_DEPARTURE,
26+
ARRIVAL_TO_ARRIVAL,
2727
}

application/src/test/java/org/opentripplanner/gtfs/mapping/FareTransferRuleMapperTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ void timeLimit() {
6868
void limitType() {
6969
assertEquals(TimeLimitType.DEPARTURE_TO_ARRIVAL, FareTransferRuleMapper.mapLimitType(0));
7070
assertEquals(TimeLimitType.DEPARTURE_TO_DEPARTURE, FareTransferRuleMapper.mapLimitType(1));
71+
assertEquals(TimeLimitType.ARRIVAL_TO_DEPARTURE, FareTransferRuleMapper.mapLimitType(2));
72+
assertEquals(TimeLimitType.ARRIVAL_TO_ARRIVAL, FareTransferRuleMapper.mapLimitType(3));
7173
}
7274

7375
@Test

0 commit comments

Comments
 (0)