use of org.codice.ddf.spatial.geocoding.FeatureIndexer in project ddf by codice.
the class GazetteerUpdateCommandTest method testFeatureIndexing.
@Test
public void testFeatureIndexing() throws Exception {
String resource = "example.geojson";
final FeatureExtractor featureExtractor = spy(new FeatureExtractor() {
@Override
public void pushFeaturesToExtractionCallback(String resource, ExtractionCallback extractionCallback) throws FeatureExtractionException {
/* stub */
}
});
final FeatureIndexer featureIndexer = spy(new FeatureIndexer() {
@Override
public void updateIndex(String resource, FeatureExtractor featureExtractor, boolean create, IndexCallback callback) throws FeatureExtractionException, FeatureIndexingException {
/* stub */
}
});
gazetteerUpdateCommand.setResource(resource);
gazetteerUpdateCommand.setFeatureExtractor(featureExtractor);
gazetteerUpdateCommand.setFeatureIndexer(featureIndexer);
gazetteerUpdateCommand.executeWithSubject();
verify(featureIndexer, times(1)).updateIndex(eq(resource), eq(featureExtractor), eq(false), any(FeatureIndexer.IndexCallback.class));
}
Aggregations