@Test
public void testDownloadIfHashIsDifferent() {

    SW360SparseAttachment attachment = createAttachment(1, 1);
    attachment.setSha1(TEST_FILE_SHA1);
    Set<SW360SparseAttachment> attachments = Collections.singleton(attachment);
    SW360Release release = createReleaseWithAttachments(1, attachments);
    ReleaseWithSources releaseWithSources =
            createReleaseWithSources(release, attachments);
    createTestFile(attachmentPath(release, attachment),
            "other content".getBytes(StandardCharsets.UTF_8));
    expectDownloads(release, attachments);
    Collection<ReleaseWithSources> result =
            sourcesExporter.downloadSources(releaseAdapter, Collections.singleton(release));
    assertThat(result).containsOnly(releaseWithSources);
    verify(releaseAdapter).processAttachment(eq(release), eq(attachment.getAttachmentId()), any());
}