Ngsi2ParsingHelper { public static GeoQuery.Geometry parseGeometry(String geometry) { try { return GeoQuery.Geometry.valueOf(geometry); } catch (IllegalArgumentException e) { throw new InvalidatedSyntaxException(geometry); } }  static Object parseTextValue(String value); static GeoQuery parseGeoQuery(String georel, String geometry, String coords); static GeoQuery.Geometry parseGeometry(String geometry); static List<Coordinate> parseCoordinates(String stringCoord);  }
@Test public void testParseGeometry() { assertEquals(GeoQuery.Geometry.box, Ngsi2ParsingHelper.parseGeometry("box")); assertEquals(GeoQuery.Geometry.line, Ngsi2ParsingHelper.parseGeometry("line")); assertEquals(GeoQuery.Geometry.point, Ngsi2ParsingHelper.parseGeometry("point")); assertEquals(GeoQuery.Geometry.polygon, Ngsi2ParsingHelper.parseGeometry("polygon")); }
@Test(expected = InvalidatedSyntaxException.class) public void testParseGeometryError() { Ngsi2ParsingHelper.parseGeometry("blah"); }