Set defaults of the modes WALK, even if one and not the others are set - #5675
Merged
Conversation
Setting them to null overrides the default of WALK, which leads to no results.
…d warning suppression.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5675 +/- ##
=============================================
+ Coverage 67.62% 67.63% +0.01%
- Complexity 16293 16299 +6
=============================================
Files 1886 1886
Lines 71549 71552 +3
Branches 7384 7387 +3
=============================================
+ Hits 48383 48393 +10
+ Misses 20661 20654 -7
Partials 2505 2505 ☔ View full report in Codecov by Sentry. |
leonardehrenfried
requested review from
habrahamsson-skanetrafiken and
leonardehrenfried
February 8, 2024 14:48
leonardehrenfried
previously approved these changes
Feb 9, 2024
leonardehrenfried
left a comment
Member
There was a problem hiding this comment.
There are tiny, nitpicky things you can improve but really no blockers.
…tion in RequestModesMapperTest.
|
|
||
| @Test | ||
| void testMapRequestModesEmptyMapReturnsDefaults() { | ||
| Map<String, StreetMode> inputModes = new HashMap<>(); |
Member
There was a problem hiding this comment.
Suggested change
| Map<String, StreetMode> inputModes = new HashMap<>(); | |
| Map<String, StreetMode> inputModes = Map.of() |
Comment on lines
+39
to
+41
| Map<String, StreetMode> inputModes = new HashMap<>(); | ||
|
|
||
| inputModes.put("egressMode", StreetMode.CAR); |
Member
There was a problem hiding this comment.
Suggested change
| Map<String, StreetMode> inputModes = new HashMap<>(); | |
| inputModes.put("egressMode", StreetMode.CAR); | |
| Map<String, StreetMode> inputModes = Map.of("egressMode", StreetMode.CAR); |
Comment on lines
+52
to
+54
| Map<String, StreetMode> inputModes = new HashMap<>(); | ||
|
|
||
| inputModes.put("directMode", StreetMode.CAR); |
Member
There was a problem hiding this comment.
Suggested change
| Map<String, StreetMode> inputModes = new HashMap<>(); | |
| inputModes.put("directMode", StreetMode.CAR); | |
| Map<String, StreetMode> inputModes = Map.of("directMode", StreetMode.CAR); |
Member
|
Thanks, if you like the Map.of() style then stay consistent within one file. |
leonardehrenfried
approved these changes
Feb 9, 2024
habrahamsson-skanetrafiken
approved these changes
Feb 9, 2024
habrahamsson-skanetrafiken
left a comment
Contributor
There was a problem hiding this comment.
This looks good to me!
t2gran
pushed a commit
that referenced
this pull request
Feb 9, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR changes the behavior of the modes field so that the "WALK" defaults are applied also when some of the access, egress, and direct modes are set. Previously the default would only be applied if none of the three are set.
Unit tests
Added new unittest for the mapping of GraphQL modes to OTP internal modes.
Documentation
Updated javadoc.