@Test
public void testUpdaterArtifactToReleaseDeleteSourcesNoSource() {

    Artifact artifact = TestUtils.mkArtifact("test", false);
    SW360Release release = createRelease("test", null);
    SW360Release createdRelease = createRelease("testCreated", null);
    SW360Release deletedRelease = createRelease("releaseNoAttachments", null);
    when(metaDataUpdater.getOrCreateRelease(release, false))
            .thenReturn(createdRelease);
    when(metaDataUpdater.deleteAttachments(eq(createdRelease), any()))
            .thenReturn(deletedRelease);
    SW360UpdaterImpl updater = new SW360UpdaterImpl(metaDataUpdater, "test", "version",
            false, false, true);
    AttachmentUploadResult<SW360Release> result =
            updater.artifactToReleaseWithUploads(artifact, release, Collections.emptyMap());
    assertThat(result.getTarget()).isEqualTo(deletedRelease);
    Predicate<SW360SparseAttachment> predicate = extractPredicateForDeleteAttachments(createdRelease);
    assertThat(predicate.test(createAttachment(Paths.get("foo"), SW360AttachmentType.SOURCE)))
            .isTrue();
    assertThat(predicate.test(createAttachment(Paths.get("foo"), SW360AttachmentType.BINARY)))
            .isFalse();
}