use of org.codice.ddf.spatial.geocoding.GeoEntryExtractor.ExtractionCallback in project ddf by codice.
the class GeoNamesFileExtractorTest method testFileExtractionStreaming.
private void testFileExtractionStreaming(final String fileLocation) throws GeoEntryExtractionException, GeoNamesRemoteDownloadException, GeoEntryIndexingException {
final ExtractionCallback extractionCallback = mock(ExtractionCallback.class);
final ArgumentCaptor<GeoEntry> geoEntryArgumentCaptor = ArgumentCaptor.forClass(GeoEntry.class);
geoNamesFileExtractor.pushGeoEntriesToExtractionCallback(fileLocation, extractionCallback);
verify(extractionCallback, atLeastOnce()).updateProgress(anyInt());
verify(extractionCallback, times(3)).extracted(geoEntryArgumentCaptor.capture());
final List<GeoEntry> capturedGeoEntryList = geoEntryArgumentCaptor.getAllValues();
verifyGeoEntryList(capturedGeoEntryList);
}
Aggregations