use of ddf.catalog.content.data.ContentItem in project ddf by codice.
the class HistorianTest method testNullContentItemStorageReadRequest.
@Test
public void testNullContentItemStorageReadRequest() throws StorageException, UnsupportedQueryException, SourceUnavailableException, IngestException, URISyntaxException {
List<Metacard> metacards = getMetacardUpdatePair();
// Parameters for historian
UpdateStorageRequest storageRequest = mock(UpdateStorageRequest.class);
UpdateStorageResponse storageResponse = mock(UpdateStorageResponse.class);
UpdateResponse updateResponse = mock(UpdateResponse.class);
// Make content item null
storageProvider.storageMap.put(METACARD_ID, null);
mockQuery(metacards.get(1));
historian.version(storageRequest, storageResponse, updateResponse);
// Verify that the content item DIDN't updated
ReadStorageRequest request = mock(ReadStorageRequest.class);
when(request.getResourceUri()).thenReturn(new URI(RESOURCE_URI));
ContentItem item = storageProvider.read(request).getContentItem();
assertThat(item, nullValue());
}
use of ddf.catalog.content.data.ContentItem in project ddf by codice.
the class HistorianTest method storeMetacard.
private void storeMetacard(Metacard metacard) {
ContentItem item = mock(ContentItem.class);
when(item.getId()).thenReturn(METACARD_ID);
when(item.getUri()).thenReturn(RESOURCE_URI);
when(item.getMetacard()).thenReturn(metacard);
storageProvider.storageMap.put(item.getUri(), item);
}
Aggregations