use of org.codice.ddf.spatial.geocoding.GeoEntryCreator in project ddf by codice.
the class GeoNamesCatalogIndexerTest method setUp.
@Before
public void setUp() throws Exception {
geoEntryCreator = mock(GeoEntryCreator.class);
when(geoEntryCreator.createGeoEntry(anyString(), anyString())).thenReturn(GEO_ENTRY);
geoEntryExtractor = new GeoNamesFileExtractor();
geoEntryExtractor.setGeoEntryCreator(geoEntryCreator);
catalogFramework = mock(CatalogFramework.class);
uuidGenerator = mock(UuidGenerator.class);
createResponse = mock(CreateResponse.class);
when(createResponse.getCreatedMetacards()).thenReturn(Collections.singletonList(METACARD));
when(catalogFramework.create(any(CreateRequest.class))).thenReturn(createResponse);
when(uuidGenerator.generateUuid()).thenReturn(UUID.randomUUID().toString());
catalogProvider = mock(CatalogProvider.class);
DeleteResponse deleteResponse = mock(DeleteResponse.class);
when(deleteResponse.getDeletedMetacards()).thenReturn(Collections.singletonList(METACARD));
when(catalogProvider.delete(any(DeleteRequest.class))).thenReturn(deleteResponse);
queryResponse = mock(QueryResponse.class);
when(queryResponse.getResults()).thenReturn(Collections.singletonList(new ResultImpl(new MetacardImpl())));
when(catalogFramework.query(any(QueryRequest.class))).thenReturn(queryResponse);
progressCallback = progress -> {
};
geoNamesCatalogIndexer = new GeoNamesCatalogIndexer(catalogFramework, uuidGenerator, new GeoEntryAttributes(), new GeotoolsFilterBuilder(), Collections.singletonList(catalogProvider));
}
Aggregations