Skip to content

Commit

Permalink
PaymentMethods.etc2 (#1589)
Browse files Browse the repository at this point in the history
  • Loading branch information
DzmitryFomchyn authored Aug 28, 2024
1 parent 987b2c9 commit ff132a5
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ Mapbox welcomes participation and contributions from everyone.

### main

### v7.2.0 - August 28, 2024

- Added `PaymentMethods#etc2` payment method.
- Added `V6StructuredInputQuery#country` option.


### v7.1.0 - July 8, 2024

- Optimize memory usage in Directions API model classes by interning frequently occurring strings in JSON


### v7.0.0 - April 23, 2024

- Added Geocoding V6 Support.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ public static Builder builder() {
@Nullable
public abstract CostPerVehicleSize etc();

/*
* Information about payment by etc2.
*
* return etc2 payment method
*/
@Nullable
public abstract CostPerVehicleSize etc2();

/*
* Information about payment by cash.
*
Expand Down Expand Up @@ -89,6 +97,15 @@ public abstract static class Builder
@NonNull
public abstract Builder etc(@Nullable CostPerVehicleSize etc);

/*
* Information about payment by etc2.
*
* param etc2 payment method
* return this builder for chaining options together
*/
@NonNull
public abstract Builder etc2(@Nullable CostPerVehicleSize etc2);

/*
* Information about payment by cash.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,25 @@ public void directionsRoute_hasTollCosts() throws IOException {
DirectionsRoute route = DirectionsRoute.fromJson(json, options, uuid);

assertEquals(2, route.tollCosts().size());

PaymentMethods paymentMethods = route.tollCosts().get(0).paymentMethods();

CostPerVehicleSize etc = CostPerVehicleSize.builder()
.middle(5566.0)
.build();
assertEquals(etc, paymentMethods.etc());

CostPerVehicleSize etc2 = CostPerVehicleSize.builder()
.middle(6789.0)
.standard(7890.0)
.build();
assertEquals(etc2, paymentMethods.etc2());

CostPerVehicleSize cash = CostPerVehicleSize.builder()
.small(123.0)
.large(4567.0)
.build();
assertEquals(cash, paymentMethods.cash());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
"etc": {
"middle": 5566
},
"etc2": {
"middle": 6789,
"standard": 7890
},
"cash": {
"small": 123,
"large": 4567
Expand Down

0 comments on commit ff132a5

Please sign in to comment.