Skip to content

Validate missing intermediate location in via requests#5253

Merged
vpaturet merged 2 commits into
opentripplanner:dev-2.xfrom
entur:validate_missing_intermediate_location
Aug 16, 2023
Merged

Validate missing intermediate location in via requests#5253
vpaturet merged 2 commits into
opentripplanner:dev-2.xfrom
entur:validate_missing_intermediate_location

Conversation

@vpaturet

Copy link
Copy Markdown
Contributor

Summary

As detailed in #5252, missing validation for the intermediate locations in via requests causes NullPointerExceptions.
This PR adds a validation rule on the intermediate location and ensures that clients get a meaningful error message

Issue

Closes #5252

Unit tests

Documentation

No

@vpaturet vpaturet marked this pull request as ready for review July 20, 2023 14:46
@vpaturet vpaturet requested a review from a team as a code owner July 20, 2023 14:46
@codecov

codecov Bot commented Jul 20, 2023

Copy link
Copy Markdown

Codecov Report

Patch coverage: 14.28% and project coverage change: +0.20% 🎉

Comparison is base (0b476db) 65.69% compared to head (afd2680) 65.90%.
Report is 77 commits behind head on dev-2.x.

Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #5253      +/-   ##
=============================================
+ Coverage      65.69%   65.90%   +0.20%     
- Complexity     14723    14782      +59     
=============================================
  Files           1770     1770              
  Lines          68556    68685     +129     
  Branches        7288     7278      -10     
=============================================
+ Hits           45037    45265     +228     
+ Misses         21025    20934      -91     
+ Partials        2494     2486       -8     
Files Changed Coverage Δ
...r/ext/transmodelapi/mapping/ViaLocationMapper.java 0.00% <0.00%> (ø)
...pentripplanner/api/mapping/PlannerErrorMapper.java 0.00% <0.00%> (ø)
...entripplanner/routing/api/request/ViaLocation.java 77.77% <33.33%> (+17.77%) ⬆️
...n/java/org/opentripplanner/api/common/Message.java 86.66% <100.00%> (+0.45%) ⬆️

... and 63 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@t2gran t2gran added this to the 2.4 (next release) milestone Jul 24, 2023
@t2gran t2gran added !Improvement A functional improvement or micro feature !Bug Apply to issues describing a bug and PRs witch fixes it. and removed !Improvement A functional improvement or micro feature labels Jul 24, 2023
Comment thread src/ext/java/org/opentripplanner/ext/transmodelapi/mapping/ViaLocationMapper.java Outdated
Comment thread src/main/resources/Message.properties
Comment thread src/main/resources/Message_de.properties
@leonardehrenfried leonardehrenfried self-requested a review July 25, 2023 08:27
@vpaturet vpaturet requested a review from t2gran July 26, 2023 14:23
@vpaturet vpaturet self-assigned this Jul 28, 2023
@vpaturet vpaturet added the Entur Test This is currently being tested at Entur label Jul 28, 2023
GEOCODE_FROM_NOT_FOUND(440),
GEOCODE_TO_NOT_FOUND(450),
GEOCODE_FROM_TO_NOT_FOUND(460),
GEOCODE_INTERMEDIATE_NOT_FOUND(465),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that the rest of the errors also have the same name but this error has nothing to do with geocoding. Should we perhaps not make it worse by giving a better name?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it make sense to rename them all in another PR with a new prefix TRIP or TRIP_SEARCH?

@leonardehrenfried leonardehrenfried left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what is more important: constistency or not using confusing names.

@vpaturet vpaturet merged commit 35e9b86 into opentripplanner:dev-2.x Aug 16, 2023
t2gran pushed a commit that referenced this pull request Aug 16, 2023
@vpaturet vpaturet deleted the validate_missing_intermediate_location branch October 16, 2023 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

!Bug Apply to issues describing a bug and PRs witch fixes it. Entur Test This is currently being tested at Entur

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NullPointerException in via routing request

3 participants