Skip to content

Commit 9f5154e

Browse files
author
Pablo Guardiola
authored
remove optimization coordinates limit check (#1339)
1 parent 10550de commit 9f5154e

2 files changed

Lines changed: 0 additions & 17 deletions

File tree

services-optimization/src/main/java/com/mapbox/api/optimization/v1/MapboxOptimization.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,6 @@ public MapboxOptimization build() {
480480
if (coordinates == null || coordinates.size() < 2) {
481481
throw new ServicesException("At least two coordinates must be provided with your API"
482482
+ "request.");
483-
} else if (coordinates.size() > 12) {
484-
throw new ServicesException("Maximum of 12 coordinates are allowed for this API.");
485483
}
486484

487485
coordinates(formatCoordinates(coordinates));

services-optimization/src/test/java/com/mapbox/api/optimization/v1/MapboxOptimizationTest.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,6 @@ public void build_invalidAccessTokenExceptionThrown() throws Exception {
9898
.coordinate(Point.fromLngLat(1.0, 1.0))
9999
.build();
100100
}
101-
@Test
102-
public void build_doesThrowTooManyCoordinatesException() throws ServicesException {
103-
int total = 13;
104-
List<Point> points = new ArrayList<>();
105-
for (int i = 0; i < total; i++) {
106-
// Fake too many positions
107-
points.add(Point.fromLngLat(1.0, 1.0));
108-
}
109-
thrown.expect(ServicesException.class);
110-
thrown.expectMessage(startsWith("Maximum of 12 coordinates are allowed for this API"));
111-
MapboxOptimization.builder()
112-
.coordinates(points)
113-
.accessToken(ACCESS_TOKEN)
114-
.build();
115-
}
116101

117102
@Test
118103
public void build_doesAddCoordinatesToUrl() throws Exception {

0 commit comments

Comments
 (0)