Search in sources :

Example 11 with UpdateStorageRequestImpl

use of ddf.catalog.content.operation.impl.UpdateStorageRequestImpl in project ddf by codice.

the class FanoutCatalogFrameworkTest method testBlacklistedTagUpdateStorageRequestFails.

@Test(expected = IngestException.class)
public void testBlacklistedTagUpdateStorageRequestFails() throws Exception {
    Metacard metacard = new MetacardImpl();
    metacard.setAttribute(new AttributeImpl(Metacard.ID, "metacardId"));
    metacard.setAttribute(new AttributeImpl(Metacard.TAGS, "blacklisted"));
    ContentItem item = new ContentItemImpl(uuidGenerator.generateUuid(), ByteSource.empty(), "text/xml", "filename.xml", 0L, metacard);
    UpdateStorageRequest request = new UpdateStorageRequestImpl(Collections.singletonList(item), new HashMap<>());
    framework.setFanoutTagBlacklist(Collections.singletonList("blacklisted"));
    framework.update(request);
}
Also used : Metacard(ddf.catalog.data.Metacard) UpdateStorageRequestImpl(ddf.catalog.content.operation.impl.UpdateStorageRequestImpl) AttributeImpl(ddf.catalog.data.impl.AttributeImpl) UpdateStorageRequest(ddf.catalog.content.operation.UpdateStorageRequest) MetacardImpl(ddf.catalog.data.impl.MetacardImpl) ContentItem(ddf.catalog.content.data.ContentItem) ContentItemImpl(ddf.catalog.content.data.impl.ContentItemImpl) Test(org.junit.Test)

Aggregations

UpdateStorageRequestImpl (ddf.catalog.content.operation.impl.UpdateStorageRequestImpl)11 UpdateStorageRequest (ddf.catalog.content.operation.UpdateStorageRequest)10 Metacard (ddf.catalog.data.Metacard)7 ContentItem (ddf.catalog.content.data.ContentItem)6 ContentItemImpl (ddf.catalog.content.data.impl.ContentItemImpl)6 IngestException (ddf.catalog.source.IngestException)6 SourceUnavailableException (ddf.catalog.source.SourceUnavailableException)6 CreateStorageRequestImpl (ddf.catalog.content.operation.impl.CreateStorageRequestImpl)5 UpdateRequestImpl (ddf.catalog.operation.impl.UpdateRequestImpl)5 CreateResponse (ddf.catalog.operation.CreateResponse)4 UpdateRequest (ddf.catalog.operation.UpdateRequest)4 MimeType (javax.activation.MimeType)4 Test (org.junit.Test)4 ByteSource (com.google.common.io.ByteSource)3 CatalogFramework (ddf.catalog.CatalogFramework)3 UpdateStorageResponse (ddf.catalog.content.operation.UpdateStorageResponse)3 UpdateResponse (ddf.catalog.operation.UpdateResponse)3 HashMap (java.util.HashMap)3 Sets (com.google.common.collect.Sets)2 ActionRegistry (ddf.action.ActionRegistry)2