-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Change the TripRequest and builder to work with include lists instead of just the FilterValues #6525
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
Change the TripRequest and builder to work with include lists instead of just the FilterValues #6525
Conversation
…d of just the FilterValues. Also introduces a NullIsEverything FilterValues which better encapsulates the logic of an include collection (which is that an empty should match nothing, but a null should match everything).
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6525 +/- ##
=============================================
+ Coverage 70.17% 70.25% +0.07%
- Complexity 18312 18373 +61
=============================================
Files 2082 2088 +6
Lines 77214 77377 +163
Branches 7831 7839 +8
=============================================
+ Hits 54188 54358 +170
+ Misses 20256 20244 -12
- Partials 2770 2775 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
...n/src/test/java/org/opentripplanner/transit/model/filter/transit/TripMatcherFactoryTest.java
Outdated
Show resolved
Hide resolved
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.
I see that there is no unit-test on the FilterValues
and FilterValuesNullsEverything
- this is ok as long as the TripMatcherFactoryTest
cover all cases. Is this the case?
Summary
This PR changes the behaviour of the ServiceJourneys Transmodel API endpoint so that null or unset values match everything, but empty lists match nothing.
This is different from today's production where arguments set to empty lists match everything, just like null or unset values. For example: https://api.entur.io/graphql-explorer/journey-planner-v3?query=%7BserviceJourneys%28authorities%3Anull%29%7Bid%7D%7D
Today's behaviour where everything is returned causes errors:

While the new behaviour causes empty lists to be returned (because nothing is matched):

Behaviour for null or unset arguments is the same (error because of too many results).
Issue
#5630
Unit tests
Tested with unit tests on the matcher resulting from the TripMatcherFactory, and by running locally.