@@ -0,0 +1,2906 @@
+package org.opensingular.form.wicket.mapper.attachment;%0A%0Aimport org.apache.wicket.Component;%0Aimport org.apache.wicket.ajax.form.AjaxFormSubmitBehavior;%0Aimport org.apache.wicket.markup.html.form.upload.FileUploadField;%0Aimport org.apache.wicket.util.file.File;%0Aimport org.apache.wicket.util.tester.FormTester;%0Aimport org.fest.assertions.core.Condition;%0Aimport org.jetbrains.annotations.NotNull;%0Aimport org.junit.After;%0Aimport org.junit.Assert;%0Aimport org.junit.Before;%0Aimport org.junit.Ignore;%0Aimport org.junit.Test;%0Aimport org.opensingular.form.SDictionary;%0Aimport org.opensingular.form.SInstance;%0Aimport org.opensingular.form.SType;%0Aimport org.opensingular.form.STypeComposite;%0Aimport org.opensingular.form.helpers.AssertionsSInstance;%0Aimport org.opensingular.form.io.HashUtil;%0Aimport org.opensingular.form.type.core.attachment.SIAttachment;%0Aimport org.opensingular.form.type.core.attachment.STypeAttachment;%0Aimport org.opensingular.form.type.core.attachment.STypeAttachmentImage;%0Aimport org.opensingular.form.view.SViewAttachmentImageTooltip;%0Aimport org.opensingular.form.wicket.helpers.AssertionsWComponent;%0Aimport org.opensingular.form.wicket.helpers.SingularDummyFormPageTester;%0Aimport org.opensingular.form.wicket.helpers.SingularFormBaseTest;%0Aimport org.opensingular.form.wicket.model.ISInstanceAwareModel;%0Aimport org.opensingular.internal.lib.commons.util.TempFileProvider;%0A%0Aimport java.io.IOException;%0Aimport java.nio.charset.Charset;%0Aimport java.nio.charset.StandardCharsets;%0A%0Aimport static org.fest.assertions.api.Assertions.assertThat;%0Aimport static org.junit.Assert.assertArrayEquals;%0Aimport static org.opensingular.form.wicket.helpers.TestFinders.findFirstComponentWithId;%0A%0A@SuppressWarnings(%22rawtypes%22)%0Apublic class AttachmentImageMapperTest %7B%0A%0A    protected TempFileProvider tmpProvider;%0A%0A    @Before%0A    public void createTmpProvider() %7B%0A        tmpProvider = TempFileProvider.createForUseInTryClause(this);%0A    %7D%0A%0A    @Test%0A    public void testRenderComponent() throws IOException %7B%0A        SingularDummyFormPageTester tester = new SingularDummyFormPageTester();%0A        tester.getDummyPage().setTypeBuilder(tb-%3Etb.addField(%22imgFile%22, STypeAttachmentImage.class));%0A        tester.getDummyPage().setAsEditView();%0A%0A        tester.startDummyPage();%0A%0A        tester.getAssertionsForm().getSubCompomentWithId(%22fileUpload%22).isNotNull();%0A    %7D%0A%0A    @Test%0A    public void testRenderTooltipMapper() throws IOException %7B%0A        SingularDummyFormPageTester tester = new SingularDummyFormPageTester();%0A        tester.getDummyPage().setTypeBuilder(tb-%3E%7B%0A            SType imgFile = tb.addField(%22imgFile%22, STypeAttachmentImage.class);%0A            imgFile.setView(SViewAttachmentImageTooltip::new);%0A        %7D);%0A        tester.getDummyPage().setAsEditView();%0A%0A        tester.startDummyPage();%0A%0A        tester.getAssertionsForm().getSubCompomentWithId(%22fileUpload%22).assertSInstance().isNotNull();%0A    %7D%0A%7D%0A

Test render attachmentImage