Search in sources :

Example 11 with CreateStorageRequest

use of ddf.catalog.content.operation.CreateStorageRequest in project ddf by codice.

the class TestVideoThumbnailPlugin method getCreatedItemThumbnail.

private byte[] getCreatedItemThumbnail(final String videoFile) throws Exception {
    setUpMockContentItem(videoFile);
    final CreateStorageResponse mockCreateResponse = mock(CreateStorageResponse.class);
    doReturn(Collections.singletonList(mockContentItem)).when(mockCreateResponse).getCreatedContentItems();
    final CreateStorageRequest mockCreateRequest = mock(CreateStorageRequest.class);
    doReturn(mockCreateRequest).when(mockCreateResponse).getRequest();
    doReturn(properties).when(mockCreateResponse).getProperties();
    final CreateStorageResponse processedCreateResponse = videoThumbnailPlugin.process(mockCreateResponse);
    return (byte[]) processedCreateResponse.getCreatedContentItems().get(0).getMetacard().getAttribute(Metacard.THUMBNAIL).getValue();
}
Also used : CreateStorageResponse(ddf.catalog.content.operation.CreateStorageResponse) CreateStorageRequest(ddf.catalog.content.operation.CreateStorageRequest)

Aggregations

CreateStorageRequest (ddf.catalog.content.operation.CreateStorageRequest)11 CreateStorageRequestImpl (ddf.catalog.content.operation.impl.CreateStorageRequestImpl)7 Metacard (ddf.catalog.data.Metacard)7 ContentItem (ddf.catalog.content.data.ContentItem)5 ContentItemImpl (ddf.catalog.content.data.impl.ContentItemImpl)5 CreateStorageResponse (ddf.catalog.content.operation.CreateStorageResponse)5 ByteSource (com.google.common.io.ByteSource)3 CreateResponse (ddf.catalog.operation.CreateResponse)3 IngestException (ddf.catalog.source.IngestException)3 Test (org.junit.Test)3 UpdateStorageRequest (ddf.catalog.content.operation.UpdateStorageRequest)2 UpdateStorageRequestImpl (ddf.catalog.content.operation.impl.UpdateStorageRequestImpl)2 CreateRequest (ddf.catalog.operation.CreateRequest)2 CreateRequestImpl (ddf.catalog.operation.impl.CreateRequestImpl)2 InternalIngestException (ddf.catalog.source.InternalIngestException)2 SourceUnavailableException (ddf.catalog.source.SourceUnavailableException)2 Subject (ddf.security.Subject)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 MimeType (javax.activation.MimeType)2