@Test
public void testDeleteSourceAttachments() {

    SW360SparseAttachment attachment1 = createAttachment("source1", SW360AttachmentType.SOURCE);
    SW360SparseAttachment attachment2 = createAttachment("source2", SW360AttachmentType.SOURCE);
    SW360SparseAttachment attachment3 = createAttachment("other1", SW360AttachmentType.BINARY);
    SW360SparseAttachment attachment4 = createAttachment("other1", SW360AttachmentType.DOCUMENT);
    SW360Release release = addAttachment(addAttachment(addAttachment(addAttachment(createRelease(RELEASE_NAME),
            attachment1), attachment2), attachment3), attachment4);
    SW360Release updatedRelease = addAttachment(addAttachment(createRelease(RELEASE_NAME), attachment3), attachment4);
    when(releaseClientAdapter.deleteAttachments(release,
            new HashSet<>(Arrays.asList(attachment1.getId(), attachment2.getId()))))
            .thenReturn(updatedRelease);
    SW360Release result = metaDataUpdater.deleteSourceAttachments(release);
    assertThat(result).isEqualTo(updatedRelease);
}