final String description = "121 elm street";
geocoderServer.geocoder = new Geocoder() {
@Override
public GeocoderResults geocode(String address, Envelope bbox) {
GeocoderResult result = new GeocoderResult(lat, lng, description);
return new GeocoderResults(Arrays.asList(result));
}
};
GeocoderResults results = geocoderServer.geocode("121 elm street", null);
for (GeocoderResult result : results.getResults()) {
// should only have one result
assertEquals("description matches", description, result.getDescription());
assertEquals(lat, result.getLat(), 0.001);
assertEquals(lng, result.getLng(), 0.001);
}
}