Search in sources :

Example 6 with ProcessCreateParams

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));
}
Also used : CreateAttachments(com.enonic.xp.attachment.CreateAttachments) CreateContentParams(com.enonic.xp.content.CreateContentParams) ProcessCreateParams(com.enonic.xp.content.processor.ProcessCreateParams) Test(org.junit.jupiter.api.Test)

Aggregations

CreateContentParams (com.enonic.xp.content.CreateContentParams)6 ProcessCreateParams (com.enonic.xp.content.processor.ProcessCreateParams)6 ProcessCreateResult (com.enonic.xp.content.processor.ProcessCreateResult)5 Test (org.junit.jupiter.api.Test)5 ExtraData (com.enonic.xp.content.ExtraData)3 XData (com.enonic.xp.schema.xdata.XData)3 CreateAttachments (com.enonic.xp.attachment.CreateAttachments)2 ContentProcessor (com.enonic.xp.content.processor.ContentProcessor)1 PropertyTree (com.enonic.xp.data.PropertyTree)1 Form (com.enonic.xp.form.Form)1 ContentType (com.enonic.xp.schema.content.ContentType)1 XDataName (com.enonic.xp.schema.xdata.XDataName)1 GeoPoint (com.enonic.xp.util.GeoPoint)1