@Test public void testUpdateProjectInvalidNoVersion() throws InterruptedException { SW360Project project = new SW360Project(); project.setName(PROJECT_NAME); CompletableFuture<SW360Project> future = projectClientAdapter.updateProject(project); try { future.get(); fail("Invalid project not detected!"); } catch (ExecutionException e) { assertThat(e.getCause()).isInstanceOf(SW360ClientException.class); assertThat(e.getCause().getMessage()).contains("invalid project"); } }
@Override public CompletableFuture<SW360Project> updateProject(SW360Project project) { return validateProjectAndProcess(project, getProjectClient()::updateProject); }
SW360ProjectClientAdapterAsyncImpl implements SW360ProjectClientAdapterAsync { @Override public CompletableFuture<SW360Project> updateProject(SW360Project project) { return validateProjectAndProcess(project, getProjectClient()::updateProject); } }
SW360ProjectClientAdapterAsyncImpl implements SW360ProjectClientAdapterAsync { @Override public CompletableFuture<SW360Project> updateProject(SW360Project project) { return validateProjectAndProcess(project, getProjectClient()::updateProject); } SW360ProjectClientAdapterAsyncImpl(SW360ProjectClient client); }
SW360ProjectClientAdapterAsyncImpl implements SW360ProjectClientAdapterAsync { @Override public CompletableFuture<SW360Project> updateProject(SW360Project project) { return validateProjectAndProcess(project, getProjectClient()::updateProject); } 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> updateProject(SW360Project project) { return validateProjectAndProcess(project, getProjectClient()::updateProject); } 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);  }