-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix stop time fetching in added or replacement trips #6245
base: dev-2.x
Are you sure you want to change the base?
Fix stop time fetching in added or replacement trips #6245
Conversation
36ef65d
to
ed3bb9b
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6245 +/- ##
=============================================
+ Coverage 69.75% 69.86% +0.10%
- Complexity 17747 17775 +28
=============================================
Files 2010 2009 -1
Lines 75948 75933 -15
Branches 7784 7785 +1
=============================================
+ Hits 52979 53048 +69
+ Misses 20260 20166 -94
- Partials 2709 2719 +10 ☔ View full report in Codecov by Sentry. |
428a549
to
df345c2
Compare
df345c2
to
38c3a5a
Compare
It has nothing to do with routing and belongs to the wrong package
better to let error propagate
it can be empty if the trip doesn't run at all
39ca3c3
to
d3d283f
Compare
application/src/main/java/org/opentripplanner/transit/service/TransitService.java
Show resolved
Hide resolved
application/src/main/java/org/opentripplanner/transit/service/TransitService.java
Show resolved
Hide resolved
application/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java
Show resolved
Hide resolved
application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java
Outdated
Show resolved
Hide resolved
public boolean equals(Object o) { | ||
if (o == null || getClass() != o.getClass()) return false; | ||
TripTimeOnDate that = (TripTimeOnDate) o; | ||
return ( | ||
stopIndex == that.stopIndex && | ||
midnight == that.midnight && | ||
Objects.equals(tripTimes, that.tripTimes) && | ||
Objects.equals(tripPattern, that.tripPattern) && | ||
Objects.equals(serviceDate, that.serviceDate) | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this used for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For testing if they are equal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a test or in main code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a unit test
I am going to wait for #5393 first. |
# Conflicts: # application/src/test/java/org/opentripplanner/transit/service/DefaultTransitServiceTest.java
Summary
This fixes problems when reading stop times for added or replacement trips.
The logic of fetching trip times is moved into
TransitService
. The list is optional because it can be empty if the trip doesn't run at all on a specified date (in contrast, an empty list would theoretically mean that the trip does run on the date, but it doesn't make any call for the whole journey).Also, the behaviour of invalid date is changed to produce an error instead of returning
null
silently in the GTFS GraphQL API, sincenull
is a valid return value meaning the trip doesn't run.Issue
Fixes #6088
Fixes #6242
Unit tests
Unit tests are added into
TransitService
for the new methods, for both existing and added trips.GraphQL Integration tests are added for one added trip and one replacement trip. This is the first time real-time updates can be integration tested.
Documentation
None needed