// Path: ngsi2-client/src/main/java/com/orange/ngsi2/exception/InvalidatedSyntaxException.java
// public class InvalidatedSyntaxException extends Ngsi2Exception {
// 
//     private final static String message = "The incoming request is invalid in this context. %s has a bad syntax.";
// 
//     public InvalidatedSyntaxException(Error error) {
//         super(error);
//     }
// 
//     public InvalidatedSyntaxException(String field) {
//         super("400", String.format(message, field), null);
//     }
// 
// }
// 
// Path: ngsi2-client/src/main/java/com/orange/ngsi2/model/GeoQuery.java
// public class GeoQuery {
// 
//     /**
//      * GeoQuery Enum model
//      */
//     public enum Relation {
//         near, coveredBy, intersects, equals, disjoint
//     }
// 
//     /**
//      * Modifier Enum model
//      */
//     public enum Modifier {
//         maxDistance, minDistance
//     }
// 
//     /**
//      * Geometry enum used for entities querying
//      */
//     public enum Geometry {
//         point, line, polygon, box
//     }
// 
//     private final Relation relation;
// 
//     private final Geometry geometry;
// 
//     private final List<Coordinate> coordinates;
// 
//     /**
//      * Defined only for a near relation
//      */
//     private final Modifier modifier;
// 
//     /**
//      * Defined only for a near relation
//      */
//     private final float distance;
// 
//     /**
//      * Default constructor
//      * @param relation relation to the geometry
//      * @param geometry geometry to match
//      * @param coordinates coordinates for the geometry
//      */
//     public GeoQuery(Relation relation, Geometry geometry, List<Coordinate> coordinates) {
//         this.relation = relation;
//         this.geometry = geometry;
//         this.coordinates = coordinates;
//         this.modifier = null;
//         this.distance = 0;
//     }
// 
//     /**
//      * Defines a near relation with modifier and distance
//      * @param modifier
//      * @param distance
//      */
//     public GeoQuery(Modifier modifier, float distance, Geometry geometry, List<Coordinate> coordinates) {
//         this.relation = Relation.near;
//         this.modifier = modifier;
//         this.distance = distance;
//         this.geometry = geometry;
//         this.coordinates = coordinates;
//     }
// 
//     public Relation getRelation() {
//         return relation;
//     }
// 
//     public Modifier getModifier() {
//         return modifier;
//     }
// 
//     public float getDistance() {
//         return distance;
//     }
// 
//     public Geometry getGeometry() {
//         return geometry;
//     }
// 
//     public List<Coordinate> getCoordinates() {
//         return coordinates;
//     }
// }


import com.orange.ngsi2.exception.InvalidatedSyntaxException;
import com.orange.ngsi2.model.GeoQuery;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import static org.junit.Assert.*;
        assertEquals(1, Ngsi2ParsingHelper.parseTextValue("1"));
        assertEquals(1.2f, Ngsi2ParsingHelper.parseTextValue("1.2"));
    }

    @Test
    public void testParseGeoQuery() {
        GeoQuery geoQuery = Ngsi2ParsingHelper.parseGeoQuery("near;minDistance:23.3", "point", "12.3,14.2");
        assertEquals(GeoQuery.Relation.near, geoQuery.getRelation());
        assertEquals(GeoQuery.Modifier.minDistance, geoQuery.getModifier());
        assertEquals(23.3, geoQuery.getDistance(), 0.1);
        assertEquals(GeoQuery.Geometry.point, geoQuery.getGeometry());
        assertEquals(1, geoQuery.getCoordinates().size());
        assertEquals(12.3, geoQuery.getCoordinates().get(0).getLatitude(), 0.1);
        assertEquals(14.2, geoQuery.getCoordinates().get(0).getLongitude(), 0.1);
    }

    @Test
    public void testParseGeometryRelations() {
        assertEquals(GeoQuery.Relation.disjoint, Ngsi2ParsingHelper.parseGeoQuery("disjoint", "point", "12.3,14.2").getRelation());
        assertEquals(GeoQuery.Relation.coveredBy, Ngsi2ParsingHelper.parseGeoQuery("coveredBy", "point", "12.3,14.2").getRelation());
        assertEquals(GeoQuery.Relation.intersects, Ngsi2ParsingHelper.parseGeoQuery("intersects", "point", "12.3,14.2").getRelation());
        assertEquals(GeoQuery.Relation.equals, Ngsi2ParsingHelper.parseGeoQuery("equals", "point", "12.3,14.2").getRelation());
    }

    @Test
    public void testParseGeometryModifiers() {
        assertEquals(GeoQuery.Modifier.maxDistance, Ngsi2ParsingHelper.parseGeoQuery("near;maxDistance:23.3", "point", "12.3,14.2").getModifier());
        assertEquals(GeoQuery.Modifier.minDistance, Ngsi2ParsingHelper.parseGeoQuery("near;minDistance:23.3", "point", "12.3,14.2").getModifier());
    }

// Path: ngsi2-client/src/main/java/com/orange/ngsi2/exception/InvalidatedSyntaxException.java
// public class InvalidatedSyntaxException extends Ngsi2Exception {
// 
//     private final static String message = "The incoming request is invalid in this context. %s has a bad syntax.";
// 
//     public InvalidatedSyntaxException(Error error) {
//         super(error);
//     }
// 
//     public InvalidatedSyntaxException(String field) {
//         super("400", String.format(message, field), null);
//     }
// 
// }
// 
// Path: ngsi2-client/src/main/java/com/orange/ngsi2/model/GeoQuery.java
// public class GeoQuery {
// 
//     /**
//      * GeoQuery Enum model
//      */
//     public enum Relation {
//         near, coveredBy, intersects, equals, disjoint
//     }
// 
//     /**
//      * Modifier Enum model
//      */
//     public enum Modifier {
//         maxDistance, minDistance
//     }
// 
//     /**
//      * Geometry enum used for entities querying
//      */
//     public enum Geometry {
//         point, line, polygon, box
//     }
// 
//     private final Relation relation;
// 
//     private final Geometry geometry;
// 
//     private final List<Coordinate> coordinates;
// 
//     /**
//      * Defined only for a near relation
//      */
//     private final Modifier modifier;
// 
//     /**
//      * Defined only for a near relation
//      */
//     private final float distance;
// 
//     /**
//      * Default constructor
//      * @param relation relation to the geometry
//      * @param geometry geometry to match
//      * @param coordinates coordinates for the geometry
//      */
//     public GeoQuery(Relation relation, Geometry geometry, List<Coordinate> coordinates) {
//         this.relation = relation;
//         this.geometry = geometry;
//         this.coordinates = coordinates;
//         this.modifier = null;
//         this.distance = 0;
//     }
// 
//     /**
//      * Defines a near relation with modifier and distance
//      * @param modifier
//      * @param distance
//      */
//     public GeoQuery(Modifier modifier, float distance, Geometry geometry, List<Coordinate> coordinates) {
//         this.relation = Relation.near;
//         this.modifier = modifier;
//         this.distance = distance;
//         this.geometry = geometry;
//         this.coordinates = coordinates;
//     }
// 
//     public Relation getRelation() {
//         return relation;
//     }
// 
//     public Modifier getModifier() {
//         return modifier;
//     }
// 
//     public float getDistance() {
//         return distance;
//     }
// 
//     public Geometry getGeometry() {
//         return geometry;
//     }
// 
//     public List<Coordinate> getCoordinates() {
//         return coordinates;
//     }
// }


// Path: ngsi2-server/src/test/java/com/orange/ngsi2/server/Ngsi2ParsingHelperTest.java
import com.orange.ngsi2.exception.InvalidatedSyntaxException;
import com.orange.ngsi2.model.GeoQuery;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import static org.junit.Assert.*;

        assertEquals(1, Ngsi2ParsingHelper.parseTextValue("1"));
        assertEquals(1.2f, Ngsi2ParsingHelper.parseTextValue("1.2"));
    }

    @Test
    public void testParseGeoQuery() {
        GeoQuery geoQuery = Ngsi2ParsingHelper.parseGeoQuery("near;minDistance:23.3", "point", "12.3,14.2");
        assertEquals(GeoQuery.Relation.near, geoQuery.getRelation());
        assertEquals(GeoQuery.Modifier.minDistance, geoQuery.getModifier());
        assertEquals(23.3, geoQuery.getDistance(), 0.1);
        assertEquals(GeoQuery.Geometry.point, geoQuery.getGeometry());
        assertEquals(1, geoQuery.getCoordinates().size());
        assertEquals(12.3, geoQuery.getCoordinates().get(0).getLatitude(), 0.1);
        assertEquals(14.2, geoQuery.getCoordinates().get(0).getLongitude(), 0.1);
    }

    @Test
    public void testParseGeometryRelations() {
        assertEquals(GeoQuery.Relation.disjoint, Ngsi2ParsingHelper.parseGeoQuery("disjoint", "point", "12.3,14.2").getRelation());
        assertEquals(GeoQuery.Relation.coveredBy, Ngsi2ParsingHelper.parseGeoQuery("coveredBy", "point", "12.3,14.2").getRelation());
        assertEquals(GeoQuery.Relation.intersects, Ngsi2ParsingHelper.parseGeoQuery("intersects", "point", "12.3,14.2").getRelation());
        assertEquals(GeoQuery.Relation.equals, Ngsi2ParsingHelper.parseGeoQuery("equals", "point", "12.3,14.2").getRelation());
    }

    @Test
    public void testParseGeometryModifiers() {
        assertEquals(GeoQuery.Modifier.maxDistance, Ngsi2ParsingHelper.parseGeoQuery("near;maxDistance:23.3", "point", "12.3,14.2").getModifier());
        assertEquals(GeoQuery.Modifier.minDistance, Ngsi2ParsingHelper.parseGeoQuery("near;minDistance:23.3", "point", "12.3,14.2").getModifier());
    }

    @Test(expected = InvalidatedSyntaxException.class)