@Test public void testCreateProject() { SW360Project projectCreated = new SW360Project(); projectCreated.setName(PROJECT_NAME); projectCreated.setVersion(PROJECT_VERSION); projectCreated.setDescription("a newly created project"); when(projectClient.createProject(projectWithLink)) .thenReturn(CompletableFuture.completedFuture(projectCreated)); SW360Project result = block(projectClientAdapter.createProject(projectWithLink)); assertThat(result).isEqualTo(projectCreated); }
@Override public CompletableFuture<SW360Project> createProject(SW360Project project) { return validateProjectAndProcess(project, getProjectClient()::createProject); }
SW360ProjectClientAdapterAsyncImpl implements SW360ProjectClientAdapterAsync { @Override public CompletableFuture<SW360Project> createProject(SW360Project project) { return validateProjectAndProcess(project, getProjectClient()::createProject); } }
SW360ProjectClientAdapterAsyncImpl implements SW360ProjectClientAdapterAsync { @Override public CompletableFuture<SW360Project> createProject(SW360Project project) { return validateProjectAndProcess(project, getProjectClient()::createProject); } SW360ProjectClientAdapterAsyncImpl(SW360ProjectClient client); }
SW360ProjectClientAdapterAsyncImpl implements SW360ProjectClientAdapterAsync { @Override public CompletableFuture<SW360Project> createProject(SW360Project project) { return validateProjectAndProcess(project, getProjectClient()::createProject); } SW360ProjectClientAdapterAsyncImpl(SW360ProjectClient client); @Override SW360ProjectClient getProjectClient(); @Override CompletableFuture<Optional<SW360Project>> getProjectByNameAndVersion(String projectName, String projectVersion); @Override CompletableFuture<List<SW360Project>> search(ProjectSearchParams params); @Override CompletableFuture<SW360Project> createProject(SW360Project project); @Override CompletableFuture<SW360Project> updateProject(SW360Project project); @Override CompletableFuture<Void> addSW360ReleasesToSW360Project(String id, Collection<SW360Release> releases); @Override CompletableFuture<List<SW360SparseRelease>> getLinkedReleases(String projectId, boolean transitive); }
SW360ProjectClientAdapterAsyncImpl implements SW360ProjectClientAdapterAsync { @Override public CompletableFuture<SW360Project> createProject(SW360Project project) { return validateProjectAndProcess(project, getProjectClient()::createProject); } SW360ProjectClientAdapterAsyncImpl(SW360ProjectClient client); @Override SW360ProjectClient getProjectClient(); @Override CompletableFuture<Optional<SW360Project>> getProjectByNameAndVersion(String projectName, String projectVersion); @Override CompletableFuture<List<SW360Project>> search(ProjectSearchParams params); @Override CompletableFuture<SW360Project> createProject(SW360Project project); @Override CompletableFuture<SW360Project> updateProject(SW360Project project); @Override CompletableFuture<Void> addSW360ReleasesToSW360Project(String id, Collection<SW360Release> releases); @Override CompletableFuture<List<SW360SparseRelease>> getLinkedReleases(String projectId, boolean transitive);  }