use of ddf.catalog.operation.impl.DeleteResponseImpl in project ddf by codice.
the class HistorianTest method testDeleteResponse.
@Test
public void testDeleteResponse() throws SourceUnavailableException, IngestException, StorageException {
Metacard metacard = getMetacardUpdatePair().get(0);
storeMetacard(metacard);
// Send a delete request
DeleteStorageRequest deleteStorageRequest = new DeleteStorageRequestImpl(Collections.singletonList(metacard), new HashMap<>());
storageProvider.delete(deleteStorageRequest);
// Version delete request
DeleteRequest deleteRequest = new DeleteRequestImpl("deleteRequest");
DeleteResponse deleteResponse = new DeleteResponseImpl(deleteRequest, new HashMap<>(), Collections.singletonList(metacard));
historian.version(deleteResponse);
// Only the version metacard is left
assertThat(storageProvider.storageMap.size(), equalTo(1));
}
use of ddf.catalog.operation.impl.DeleteResponseImpl in project ddf by codice.
the class RemoteDeleteOperationsTest method setUpDeleteRequest.
private void setUpDeleteRequest() {
MetacardImpl metacard = new MetacardImpl();
ArrayList<Metacard> metacardList = new ArrayList<>();
metacard.setId("Bob");
metacard.setTitle("Bob's Title");
metacardList.add(metacard);
metacard = new MetacardImpl();
metacard.setId("Bobbert");
metacard.setTitle("Bobbert's Title");
metacardList.add(metacard);
deleteRequest = new DeleteRequestImpl(metacard.getId());
deleteResponse = new DeleteResponseImpl(deleteRequest, new HashMap(), metacardList);
}
use of ddf.catalog.operation.impl.DeleteResponseImpl in project ddf by codice.
the class HistorianTest method testDeleteResponseNoContentItems.
@Test
public void testDeleteResponseNoContentItems() throws SourceUnavailableException, IngestException, StorageException {
Metacard metacard = getMetacardUpdatePair().get(0);
DeleteRequest deleteRequest = new DeleteRequestImpl("deleteRequest");
DeleteResponse deleteResponse = new DeleteResponseImpl(deleteRequest, new HashMap<>(), Collections.singletonList(metacard));
historian.version(deleteResponse);
assertThat(storageProvider.storageMap.size(), equalTo(0));
}
use of ddf.catalog.operation.impl.DeleteResponseImpl in project ddf by codice.
the class HistorianTest method testDeleteResponseSetSkipFlag.
@Test
public void testDeleteResponseSetSkipFlag() throws SourceUnavailableException, IngestException, StorageException {
Metacard metacard = getMetacardUpdatePair().get(0);
storeMetacard(metacard);
// Send a delete request
DeleteStorageRequest deleteStorageRequest = new DeleteStorageRequestImpl(Collections.singletonList(metacard), new HashMap<>());
storageProvider.delete(deleteStorageRequest);
// Version delete request
DeleteRequest deleteRequest = new DeleteRequestImpl("deleteRequest");
DeleteResponse deleteResponse = new DeleteResponseImpl(deleteRequest, new HashMap<>(), Collections.singletonList(metacard));
historian.version(deleteResponse);
assertThat(deleteResponse.getProperties(), hasEntry(MetacardVersion.SKIP_VERSIONING, true));
}
use of ddf.catalog.operation.impl.DeleteResponseImpl in project ddf by codice.
the class CachingFederationStrategyTest method testProcessDeleteResponse.
@Test
public void testProcessDeleteResponse() throws Exception {
Map<String, Serializable> testMap = new HashMap<>();
testMap.put(Constants.SERVICE_TITLE, MOCK_RESPONSE_TITLE);
DeleteResponse response = new DeleteResponseImpl(mock(DeleteRequestImpl.class), testMap, new ArrayList<>());
response = strategy.process(response);
assertThat(response.getPropertyValue(Constants.SERVICE_TITLE), is(MOCK_RESPONSE_TITLE));
}
Aggregations