use of org.codice.ddf.spatial.geocoder.GeoResult in project ddf by codice.
the class TestGeoNamesLocalIndex method testWithResults.
@Test
public void testWithResults() throws GeoEntryQueryException {
final List<GeoEntry> topResults = Arrays.asList(GEO_ENTRY_1, GEO_ENTRY_2);
doReturn(topResults).when(geoEntryQueryable).query("Phoenix", 1);
final GeoResult geoResult = geoNamesLocalIndex.getLocation("Phoenix");
assertThat(geoResult.getFullName(), is(equalTo(GEO_ENTRY_1.getName())));
final Point point = new PointImpl(new DirectPositionImpl(GEO_ENTRY_1.getLongitude(), GEO_ENTRY_1.getLatitude()));
assertThat(geoResult.getPoint(), is(equalTo(point)));
}
Aggregations