@Test
public void testUpdaterArtifactToReleaseWithSourceAndAdditionalUpload() throws IOException {

    Path sourceFile = createTestFile();
    Path uploadFile = createTestFile();
    Map<Path, SW360AttachmentType> uploadMap =
            Collections.singletonMap(uploadFile, SW360AttachmentType.CLEARING_REPORT);
    Artifact artifact = TestUtils.mkArtifact("test", false);
    artifact.addFact(new ArtifactSourceFile(sourceFile));
    SW360Release release = createRelease("test", sourceFile);
    SW360Release createdRelease = createRelease("testCreated", sourceFile);
    SW360Release updatedRelease = createRelease("testUpdated", sourceFile);
    AttachmentUploadResult<SW360Release> uploadResult = new AttachmentUploadResult<>(updatedRelease);
    Map<Path, SW360AttachmentType> expUploads = new HashMap<>();
    expUploads.put(sourceFile, SW360AttachmentType.SOURCE);
    expUploads.put(uploadFile, SW360AttachmentType.CLEARING_REPORT);
    when(metaDataUpdater.getOrCreateRelease(release, false))
            .thenReturn(createdRelease);
    when(metaDataUpdater.uploadAttachments(createdRelease, expUploads, false))
            .thenReturn(uploadResult);
    SW360UpdaterImpl updater = new SW360UpdaterImpl(metaDataUpdater, "test", "version",
            false, true, false);
    AttachmentUploadResult<SW360Release> result =
            updater.artifactToReleaseWithUploads(artifact, release, uploadMap);
    assertThat(result).isEqualTo(uploadResult);
}