@Test
public void testUpdateAttachmentsRemoveAll() {

    PortletRequest request = Mockito.mock(PortletRequest.class);
    new TestUserCacheHolder().enable();
    // fill existing data
    Set<Attachment> documentAttachments = createAttachments("1", "2", "3");
    // fill request
    setAttachmentIds(request);
    setAttachmentFilenames(request);
    setAttachmentTypes(request);
    setAttachmenCreatedComments(request);
    setAttachmentCheckStatus(request);
    setAttachmentCheckComment(request);
    // run tests
    Set<Attachment> updatedAttachments = PortletUtils.updateAttachmentsFromRequest(request, documentAttachments);
    assertThat(documentAttachments.size(), is(3));
    assertTrue(updatedAttachments.isEmpty());
}