@Test
public void testCreateReleaseAlreadyPresent() {

    SW360SparseRelease sparseRelease = new SW360SparseRelease()
            .setVersion(release.getVersion());
    String componentHref = "url/" + ID;
    Self componentSelf = new Self().setHref(componentHref);
    LinkObjects links = new LinkObjects()
            .setSelf(componentSelf);
    SW360Component component = getSw360Component(sparseRelease, "componentName");
    component.setLinks(links);
    when(componentClientAdapter.getComponentByName(release.getName()))
            .thenReturn(CompletableFuture.completedFuture(Optional.of(component)));
    try {
        block(releaseClientAdapter.createRelease(release));
        fail("Existing release not detected");
    } catch (SW360ClientException e) {
        assertThat(e.getMessage()).contains("release already exists");
    }
}