Search in sources :

Example 1 with JsonParser.parseString

use of com.google.gson.JsonParser.parseString in project mapbox-java by mapbox.

the class RouteOptionsTest method routeOptionsWithExcludePointToJson.

@Test
public void routeOptionsWithExcludePointToJson() {
    RouteOptions options = RouteOptions.builder().coordinates("1.0,1.0;2.0,2.0").profile(DirectionsCriteria.PROFILE_DRIVING).excludeObject(Exclude.builder().points(Arrays.asList(Point.fromLngLat(11.0, 22.0))).build()).build();
    String json = options.toJson();
    String exclude = JsonParser.parseString(json).getAsJsonObject().get("exclude").getAsString();
    assertEquals("point(11.0 22.0)", exclude);
}
Also used : JsonParser.parseString(com.google.gson.JsonParser.parseString) Test(org.junit.Test)

Aggregations

JsonParser.parseString (com.google.gson.JsonParser.parseString)1 Test (org.junit.Test)1