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();
}
Aggregations