use of ddf.catalog.content.operation.ReadStorageRequest 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());
}
Aggregations