Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,6 @@ public Builder destination(@NonNull Point destination) {
* @since 3.0.0
*/
public Builder addWaypoint(@NonNull Point waypoint) {
if (coordinates.size() > 23) {
throw new ServicesException("A max of 25 coordinates including the origin and destination"
+ "values can be used inside your request.");
}
coordinates.add(waypoint);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,6 @@ public void sanity() throws Exception {
Assert.assertNotNull(mapboxDirections);
}

@Test
public void addWaypoint_maxWaypointsAdded() throws Exception {
thrown.expect(ServicesException.class);
thrown.expectMessage("A max of 25 coordinates including the origin and destination");
MapboxDirections.Builder mapboxDirectionsBuilder = MapboxDirections.builder();
for (int i = 0; i < 25; i++) {
mapboxDirectionsBuilder.addWaypoint(Point.fromLngLat(i, i + 1));
}
mapboxDirectionsBuilder.accessToken(ACCESS_TOKEN).build().executeCall();
}

@Test
public void build_noAccessTokenExceptionThrown() throws Exception {
thrown.expect(IllegalStateException.class);
Expand Down