@Test
public void testGetComponentByName() {

    LinkObjects linkObjects = makeLinkObjects();
    sparseComponent.setName(COMPONENT_NAME)
            .setLinks(linkObjects);
    component.setName(COMPONENT_NAME);
    when(componentClient.getComponent(COMPONENT_ID))
            .thenReturn(CompletableFuture.completedFuture(component));
    when(componentClient.search(NAME_SEARCH_PARAMS))
            .thenReturn(createSearchResult(Collections.singletonList(sparseComponent)));
    Optional<SW360Component> componentByName = block(componentClientAdapter.getComponentByName(COMPONENT_NAME));
    assertThat(componentByName).isPresent();
    assertThat(componentByName).hasValue(component);
    verify(componentClient).getComponent(COMPONENT_ID);
}