use of org.springframework.data.mongodb.core.geo.GeoJsonLineString in project spring-data-mongodb by spring-projects.
the class MongoQueryCreatorUnitTests method queryShouldThrowExceptionWhenArgumentDoesNotMatchDeclaration.
// DATAMONGO-1588
@Test
public void queryShouldThrowExceptionWhenArgumentDoesNotMatchDeclaration() {
expection.expect(IllegalArgumentException.class);
expection.expectMessage("Expected parameter type of " + Point.class);
PartTree tree = new PartTree("findByLocationNear", User.class);
ConvertingParameterAccessor accessor = getAccessor(converter, new GeoJsonLineString(new Point(-74.044502D, 40.689247D), new Point(-73.997330D, 40.730824D)));
new MongoQueryCreator(tree, accessor, context).createQuery();
}
use of org.springframework.data.mongodb.core.geo.GeoJsonLineString in project spring-data-mongodb by spring-projects.
the class CriteriaTests method intersectsShouldWrapGeoJsonTypeInGeometryCorrectly.
// DATAMONGO-1134
@Test
public void intersectsShouldWrapGeoJsonTypeInGeometryCorrectly() {
GeoJsonLineString lineString = new GeoJsonLineString(new Point(0, 0), new Point(10, 10));
Document document = new Criteria("foo").intersects(lineString).getCriteriaObject();
assertThat(document, isBsonObject().containing("foo.$geoIntersects.$geometry", lineString));
}
Aggregations