@Test
public void testGetOrCreateReleaseFoundByNameAndVersion() {

    SW360SparseRelease sparseRelease = new SW360SparseRelease();
    SW360Release foundRelease = new SW360Release();
    SW360Release queryRelease = new SW360Release();
    queryRelease.setExternalIds(Collections.singletonMap("id", "42"));
    foundRelease.setExternalIds(Collections.singletonMap("id2", "47"));
    queryRelease.setName("theComponent");
    queryRelease.setVersion("100.0");
    when(releaseClientAdapter.getSparseReleaseByExternalIds(queryRelease.getExternalIds())).thenReturn(Optional.empty());
    when(releaseClientAdapter.getSparseReleaseByNameAndVersion(queryRelease.getName(), queryRelease.getVersion()))
            .thenReturn(Optional.of(sparseRelease));
    when(releaseClientAdapter.enrichSparseRelease(sparseRelease)).thenReturn(Optional.of(foundRelease));
    assertThat(metaDataUpdater.getOrCreateRelease(queryRelease, false)).isEqualTo(queryRelease);
    assertThat(queryRelease.getExternalIds()).containsKey("id2");
    verify(releaseClientAdapter, never()).updateRelease(any());
}