MapboxOptimization extends MapboxService<OptimizationResponse, OptimizationService> { public static Builder builder() { return new AutoValue_MapboxOptimization.Builder() .baseUrl(Constants.BASE_API_URL) .profile(DirectionsCriteria.PROFILE_DRIVING) .user(DirectionsCriteria.PROFILE_DEFAULT_USER) .geometries(DirectionsCriteria.GEOMETRY_POLYLINE6); } protected  MapboxOptimization(); static Builder builder();  }
@Test public void build_doesThrowTwoCoordinateMinException() throws Exception { thrown.expect(ServicesException.class); thrown.expectMessage(startsWith("At least two coordinates must be provided with your")); MapboxOptimization.builder().build(); }
@Test public void build_noAccessTokenExceptionThrown() throws Exception { thrown.expect(IllegalStateException.class); thrown.expectMessage("Missing required properties: accessToken"); MapboxOptimization.builder() .coordinate(Point.fromLngLat(1.0, 1.0)) .coordinate(Point.fromLngLat(1.0, 1.0)) .build(); }