@Test
public void testUploadAttachmentsConflictFailuresAreAddedToResult() throws IOException {

    Path uploadPath1 = createTestFile(attachmentPath("conflict.doc"), TEST_FILE_CONTENT + "_other");
    Path uploadPath2 = createTestFile(attachmentPath("sources.zip"), TEST_FILE_CONTENT);
    SW360AttachmentType attachmentType = SW360AttachmentType.SOURCE;
    Map<Path, SW360AttachmentType> attachments = new HashMap<>();
    attachments.put(uploadPath1, attachmentType);
    attachments.put(uploadPath2, attachmentType);
    SW360SparseAttachment attachment = createAttachment(uploadPath1.getFileName().toString(), attachmentType);
    SW360Release release = addAttachment(createRelease(RELEASE_NAME), attachment);
    AttachmentUploadRequest<SW360Release> expRequest = AttachmentUploadRequest.builder(release)
            .addAttachment(uploadPath2, attachmentType)
            .build();
    AttachmentUploadResult<SW360Release> expResult = new AttachmentUploadResult<>(createRelease("update"));
    when(releaseClientAdapter.uploadAttachments(expRequest))
            .thenReturn(expResult);
    AttachmentUploadResult<SW360Release> uploadResult =
            metaDataUpdater.uploadAttachments(release, attachments, false);
    assertThat(uploadResult.failedUploads().keySet())
            .containsOnly(new AttachmentUploadRequest.Item(uploadPath1, attachmentType));
}