Skip to content

[NAVAND-830] payment methods [DO-NOT-MERGE]#1449

Merged
dzinad merged 1 commit intomainfrom
vv-payment-options
Nov 11, 2022
Merged

[NAVAND-830] payment methods [DO-NOT-MERGE]#1449
dzinad merged 1 commit intomainfrom
vv-payment-options

Conversation

@vadzim-vys
Copy link
Copy Markdown
Contributor

No description provided.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 7, 2022

Codecov Report

Merging #1449 (d8f3ab3) into main (bab9e05) will decrease coverage by 1.14%.
The diff coverage is 100.00%.

❗ Current head d8f3ab3 differs from pull request most recent head 526e833. Consider uploading reports for the commit 526e833 to get more accurate results

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1449      +/-   ##
============================================
- Coverage     76.90%   75.76%   -1.15%     
+ Complexity      937      883      -54     
============================================
  Files           129      125       -4     
  Lines          4019     3911     -108     
  Branches        582      578       -4     
============================================
- Hits           3091     2963     -128     
- Misses          678      686       +8     
- Partials        250      262      +12     
Impacted Files Coverage Δ
...ox/api/directions/v5/models/IntersectionLanes.java 100.00% <ø> (ø)
.../mapbox/api/directions/v5/models/RouteOptions.java 86.17% <100.00%> (-8.89%) ⬇️
...com/mapbox/api/directions/v5/MapboxDirections.java 89.16% <100.00%> (-0.44%) ⬇️
.../main/java/com/mapbox/turf/TurfTransformation.java 0.00% <0.00%> (-76.00%) ⬇️
.../com/mapbox/api/directions/v5/models/Metadata.java 0.00% <0.00%> (-42.86%) ⬇️
...om/mapbox/api/directions/v5/utils/FormatUtils.java 70.42% <0.00%> (-12.68%) ⬇️
...apbox/api/matching/v5/MatchingResponseFactory.java 93.87% <0.00%> (-0.13%) ⬇️
...n/java/com/mapbox/geojson/utils/PolylineUtils.java 78.09% <0.00%> (ø)
... and 15 more

}

/**
* Retention policy for the various payment methods.
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.

Why do we call it a retention policy? It thought it means something different in the context of JVM 🤔

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it's legacy from the previous version, that we copy-and-paste whenever Defs are used. Feel free to change it

@vadzim-vys vadzim-vys marked this pull request as ready for review June 8, 2022 15:53
@vadzim-vys vadzim-vys requested a review from a team as a code owner June 8, 2022 15:53
@vadzim-vys vadzim-vys changed the title payment methods payment methods [DO-NOT-MERGE] Jun 8, 2022
@vadzim-vys
Copy link
Copy Markdown
Contributor Author

@LukasPaczos , @RingerJK , @dzinad , the PR isn't ready to be merged but it's ready for review 🙂

@Test
public void emptyPaymentMethodsList() {
RouteOptions routeOptions = routeOptions().toBuilder()
.paymentMethodsList(Collections.<String>emptyList())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a test that checks what happens if you pass null (if it's supported) or don't call the method at all?

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.

Nope. I just felt confidence in case of null, because it's a default value. I didn't felt confidence in case of an empty list and added the test 🙂
If you think it's important, I will add a test for the null case 👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What will happen? Will there be a parameter with an empty string or no parameter at all? Since it's no parameter at all for an empty list I guess it will be the same for null so here I don't think it's necessary. I usually add tests for null and empty as a rule, just to be sure. No pressure tho. :)

* @return this builder
*/
@NonNull
public abstract Builder paymentMethods(@Nullable String paymentMethods);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We're missing updates to MapboxDirections that use this new parameter (and corresponding request/response tests).

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.

Added. But I'm not sure about response tests in the services-directions module. They seem like a duplication of tests from the services-dirctions-model module, as they just check how a JSON test file transforms to model. WDYT?

@vadzim-vys vadzim-vys requested a review from LukasPaczos June 14, 2022 11:35
@dzinad dzinad force-pushed the vv-payment-options branch 2 times, most recently from eda159f to aa31cbb Compare November 4, 2022 15:52
@dzinad
Copy link
Copy Markdown
Contributor

dzinad commented Nov 4, 2022

Fixed the conflicts, but the feature is temporarily removed from backend. Will place the ticket in "to track" and wait for the updates (targeting next week).

@dzinad dzinad force-pushed the vv-payment-options branch from aa31cbb to d2e5736 Compare November 4, 2022 16:00
@LukasPaczos LukasPaczos changed the title payment methods [DO-NOT-MERGE] [NAVAND-830] payment methods [DO-NOT-MERGE] Nov 7, 2022
@dzinad dzinad force-pushed the vv-payment-options branch 2 times, most recently from bf17a46 to aec6240 Compare November 9, 2022 14:39
@dzinad
Copy link
Copy Markdown
Contributor

dzinad commented Nov 9, 2022

Tested it on staging. Works fine, I've adjusted some string constants. Leaving the DO NOT MERGE label until it's in production.

@dzinad dzinad force-pushed the vv-payment-options branch from aec6240 to 04c4723 Compare November 9, 2022 14:40
Copy link
Copy Markdown
Contributor

@LukasPaczos LukasPaczos left a comment

Choose a reason for hiding this comment

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

LGTM but let's double-check the lane data validity and docs before merging, as discussed internally.

@dzinad dzinad force-pushed the vv-payment-options branch from 04c4723 to 526e833 Compare November 11, 2022 11:02
@dzinad dzinad merged commit bde58e6 into main Nov 11, 2022
@dzinad dzinad deleted the vv-payment-options branch November 11, 2022 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants