use of com.enonic.xp.content.processor.ProcessCreateParams in project xp by enonic.
the class ImageContentProcessorTest method testCreateMoreThanOneAttachmentFails.
@Test
public void testCreateMoreThanOneAttachmentFails() {
final CreateAttachments createAttachments = CreateAttachments.create().add(CreateAttachment.create().name("myAtt1").byteSource(ByteSource.wrap("this is 1st stuff".getBytes())).text("This is the text").build()).add(CreateAttachment.create().name("myAtt2").byteSource(ByteSource.wrap("this is 2nd stuff".getBytes())).text("This is the text").build()).build();
final CreateContentParams params = createContentParams(createAttachments);
final ProcessCreateParams processCreateParams = new ProcessCreateParams(params, MediaInfo.create().build());
assertThrows(IllegalArgumentException.class, () -> this.imageContentProcessor.processCreate(processCreateParams));
}
Aggregations