@Test
public void testCreateProjectWithProjectNotPresent() {

    final String projectName = "projectName";
    final String projectVersion = "projectVersion";
    final String projectId = "12345";
    final SW360Project newProject = new SW360Project();
    newProject.setName(projectName);
    newProject.setVersion(projectVersion);
    newProject.getLinks().setSelf(new Self("http://some.link/" + projectId));
    when(projectClientAdapter.getProjectByNameAndVersion(projectName, projectVersion))
            .thenReturn(Optional.empty());
    when(projectClientAdapter.createProject(any()))
            .thenReturn(newProject);
    metaDataUpdater.createProject(projectName, projectVersion, Collections.emptySet());
    ArgumentCaptor<SW360Project> captor = ArgumentCaptor.forClass(SW360Project.class);
    verify(projectClientAdapter, times(1)).createProject(captor.capture());
    verify(projectClientAdapter, times(1)).addSW360ReleasesToSW360Project(projectId, Collections.emptySet());
    SW360Project sampleProject = captor.getValue();
    assertThat(sampleProject.getName()).isEqualTo(projectName);
    assertThat(sampleProject.getVersion()).isEqualTo(projectVersion);
    assertThat(sampleProject.getDescription()).isEqualTo(projectName + " " + projectVersion);
    assertThat(sampleProject.getProjectType()).isEqualTo(SW360ProjectType.PRODUCT);
    assertThat(sampleProject.getVisibility()).isEqualTo(SW360Visibility.BUISNESSUNIT_AND_MODERATORS);
}