Search in sources :

Example 1 with DeletedMetacard

use of ddf.catalog.core.versioning.DeletedMetacard in project ddf by codice.

the class HistorianTest method mockQuery.

private void mockQuery(Metacard metacard) throws UnsupportedQueryException {
    SourceResponse sourceResponse = mock(SourceResponse.class);
    Result result = mock(Result.class);
    when(result.getMetacard()).thenReturn(metacard);
    Result noResult = mock(Result.class);
    Result deletedResult = mock(Result.class);
    DeletedMetacard deletedMetacard = mock(DeletedMetacard.class);
    when(deletedMetacard.getId()).thenReturn(DELETED_METACARD_ID);
    when(deletedMetacard.getMetacardType()).thenReturn(DeletedMetacardImpl.getDeletedMetacardType());
    when(deletedResult.getMetacard()).thenReturn(deletedMetacard);
    Result notVersionedResult = mock(Result.class);
    Metacard versionedMetacard = mock(MetacardVersion.class);
    when(versionedMetacard.getId()).thenReturn(VERSIONED_METACARD_ID);
    when(versionedMetacard.getMetacardType()).thenReturn(MetacardVersionImpl.getMetacardVersionType());
    when(notVersionedResult.getMetacard()).thenReturn(versionedMetacard);
    when(sourceResponse.getResults()).thenReturn(Arrays.asList(deletedResult, result, noResult, notVersionedResult));
    when(catalogProvider.query(any())).thenReturn(sourceResponse);
}
Also used : DeletedMetacard(ddf.catalog.core.versioning.DeletedMetacard) Metacard(ddf.catalog.data.Metacard) SourceResponse(ddf.catalog.operation.SourceResponse) DeletedMetacard(ddf.catalog.core.versioning.DeletedMetacard) Result(ddf.catalog.data.Result)

Aggregations

DeletedMetacard (ddf.catalog.core.versioning.DeletedMetacard)1 Metacard (ddf.catalog.data.Metacard)1 Result (ddf.catalog.data.Result)1 SourceResponse (ddf.catalog.operation.SourceResponse)1