@Test
public void testCreateReleaseNewComponent() {

    SW360Component componentForRelease = SW360ComponentAdapterUtils.createFromRelease(release);
    SW360Component componentCreated = new SW360Component();
    componentCreated.setName(release.getName());
    componentCreated.getLinks().setSelf(new Self("https://components.org/" + ID));
    when(componentClientAdapter.getComponentByName(release.getName()))
            .thenReturn(CompletableFuture.completedFuture(Optional.empty()));
    when(componentClientAdapter.createComponent(componentForRelease))
            .thenReturn(CompletableFuture.completedFuture(componentCreated));
    SW360Release releaseCreated = new SW360Release();
    releaseCreated.setName(release.getName() + "_new");
    when(releaseClient.createRelease(release))
            .thenAnswer(invocationOnMock -> {
                SW360Release r = invocationOnMock.getArgument(0);
                assertThat(r.getComponentId()).isEqualTo(ID);
                return CompletableFuture.completedFuture(releaseCreated);
            });
    SW360Release result = block(releaseClientAdapter.createRelease(release));
    assertThat(result).isEqualTo(releaseCreated);
}