use of org.codice.ddf.spatial.geocoding.context.NearbyLocation in project ddf by codice.
the class TestGeoNamesQueryLuceneIndex method testNearestCitiesWithBlankWKT.
@Test(expected = java.text.ParseException.class)
public void testNearestCitiesWithBlankWKT() throws java.text.ParseException, GeoEntryQueryException {
String testPoint = "";
final int requestedMaxResults = 2;
final int actualResults = 0;
final List<NearbyLocation> nearestCities = directoryIndex.getNearestCities(testPoint, 50, requestedMaxResults);
assertThat(nearestCities.size(), is(actualResults));
}
use of org.codice.ddf.spatial.geocoding.context.NearbyLocation in project ddf by codice.
the class TestGeoNamesLocalIndex method testGetNearbyCitiesParseException.
@Test
public void testGetNearbyCitiesParseException() throws ParseException, GeoEntryQueryException {
when(geoEntryQueryable.getNearestCities("POINT(1.0 20)", 50, 1)).thenThrow(new ParseException("", 1));
NearbyLocation returnedNearbyLocation = geoNamesLocalIndex.getNearbyCity("POINT(1.0 20)");
assertThat(returnedNearbyLocation, nullValue());
}
Aggregations