use of org.springframework.data.elasticsearch.core.geo.GeoJsonPoint in project spring-data-elasticsearch by spring-projects.
the class CriteriaQueryMappingUnitTests method shouldMapNamesInGeoJsonQuery.
// DATAES-931
@Test
@DisplayName("should map names in GeoJson query")
void shouldMapNamesInGeoJsonQuery() throws JSONException {
GeoJsonPoint geoJsonPoint = GeoJsonPoint.of(1.2, 3.4);
CriteriaQuery criteriaQuery = new CriteriaQuery(new Criteria("geoShapeField").intersects(geoJsonPoint));
String base64Query = getBase64EncodedGeoShapeQuery(geoJsonPoint, "geo-shape-field", "intersects");
String expected = //
"{\n" + //
" \"wrapper\": {\n" + " \"query\": \"" + base64Query + //
"\"\n" + //
" }\n" + //
"}\n";
mappingElasticsearchConverter.updateQuery(criteriaQuery, GeoShapeEntity.class);
String queryString = new CriteriaFilterProcessor().createFilter(criteriaQuery.getCriteria()).toString();
assertEquals(expected, queryString, false);
}
Aggregations