Empty stop_headsign will fall back to trip_headsign#5205
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5205 +/- ##
=============================================
+ Coverage 65.39% 65.54% +0.15%
- Complexity 14476 14614 +138
=============================================
Files 1755 1761 +6
Lines 68005 68343 +338
Branches 7230 7289 +59
=============================================
+ Hits 44474 44798 +324
+ Misses 21067 21055 -12
- Partials 2464 2490 +26
☔ View full report in Codecov by Sentry. |
|
Can you autoformat your code? |
|
I had already done it. But apparently there are still things missing. |
| import org.opentripplanner.transit.model._data.TransitModelForTest; | ||
| import org.opentripplanner.transit.model.framework.Deduplicator; | ||
|
|
||
| class TripTimesTest { |
There was a problem hiding this comment.
We already have a TripTimesTest but it's in the wrong package.
Can you move it here and rename it TripTimesUpdateTest?
There was a problem hiding this comment.
With a bit of refactoring, it was actually quite easy to merge both test classes.
There was a problem hiding this comment.
Thanks for that.
Could I perhaps ask for one more round of refactoring?
- remove the @BeforeAll from
createInitialTripTimes, simply call the method in those tests that actually need it and makeoriginalTripTimesa local variable - move your headsign tests into a nested class with the @nested annotation, like this
I know it's a bit nitpicky but I like well structured tests.
There was a problem hiding this comment.
Will look into it.
|
@hbtjma I'm assuming that you don't have the merge permission so I will take the liberty to do it for you. |
|
Related: #5290 |
Summary
If a stop_headsign is not set, OTP will fall back to trip_headsign.
Issue
#5204
Closes #5204
Unit tests
Added test that covers all scenarios:
Additionally verified the solution manually with our data.