SW360ProjectClientAdapterAsyncImpl implements SW360ProjectClientAdapterAsync { @Override public CompletableFuture<List<SW360Project>> search(ProjectSearchParams params) { return getProjectClient().search(params); } 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);  }
@Test public void testSearch() { ProjectSearchParams searchParams = ProjectSearchParams.builder() .withTag("testTag") .withBusinessUnit("testUnit") .build(); when(projectClient.search(searchParams)) .thenReturn(CompletableFuture.completedFuture(Collections.singletonList(projectWithLink))); List<SW360Project> projects = block(projectClientAdapter.search(searchParams)); assertThat(projects).containsOnly(projectWithLink); }