@Test
public void testDownloadAttachment() {

    final Path downloadPath = Paths.get("");
    final SW360Release release = new SW360Release();
    final SW360SparseAttachment attachment = new SW360SparseAttachment().setFilename("attachmentFile.file");
    final Path attachmentPath = downloadPath.resolve(attachment.getFilename());
    when(releaseClientAdapter.downloadAttachment(release, attachment, downloadPath))
            .thenReturn(Optional.of(attachmentPath));
    setUp();
    final Optional<Path> downloadedAttachmentPath = metaDataReceiver.downloadAttachment(release, attachment, downloadPath);
    assertThat(downloadedAttachmentPath).isPresent();
    assertThat(downloadedAttachmentPath).hasValue(attachmentPath);
    verify(releaseClientAdapter, times(1)).downloadAttachment(release, attachment, downloadPath);
}