ProjectRestApi extends ApiBase implements ProjectApi { @Override public void deleteAsync(final String id, final FutureCallback<Task> responseCallback) throws IOException { deleteObjectAsync(id, responseCallback); } ProjectRestApi(RestClient restClient); @Override String getBasePath(); @Override Project getProject(String projectId); @Override void getProjectAsync(final String projectId, final FutureCallback<Project> responseCallback); @Override ResourceList<Task> getTasksForProject(String projectId); @Override void getTasksForProjectAsync(final String projectId, final FutureCallback<ResourceList<Task>>
      responseCallback); @Override Task delete(String id); @Override void deleteAsync(final String id, final FutureCallback<Task> responseCallback); @Override Task createDisk(String projectId, DiskCreateSpec diskCreateSpec); @Override void createDiskAsync(final String projectId, final DiskCreateSpec diskCreateSpec, final FutureCallback<Task>
      responseCallback); @Override ResourceList<PersistentDisk> getDisksInProject(String projectId); @Override void getDisksInProjectAsync(final String projectId,
                                     final FutureCallback<ResourceList<PersistentDisk>> responseCallback); @Override Task createVm(String projectId, VmCreateSpec vmCreateSpec); @Override void createVmAsync(final String projectId, final VmCreateSpec vmCreateSpec, final FutureCallback<Task>
      responseCallback); @Override ResourceList<FlavoredCompact> getVmsInProject(String projectId); @Override ResourceList<Vm> getVmDetailsInProject(String projectId); @Override void getVmsInProjectAsync(final String projectId, final FutureCallback<ResourceList<FlavoredCompact>>
      responseCallback); @Override Task createCluster(String projectId, ClusterCreateSpec clusterCreateSpec); @Override void createClusterAsync(final String projectId, final ClusterCreateSpec clusterCreateSpec,
                                 final FutureCallback<Task> responseCallback); @Override ResourceList<Cluster> getClustersInProject(String projectId); @Override void getClustersInProjectAsync(final String projectId, final FutureCallback<ResourceList<Cluster>>
      responseCallback);  }
@Test public void testDeleteAsync() throws IOException, InterruptedException { final Task responseTask = new Task(); responseTask.setId("12345"); responseTask.setState("QUEUED"); responseTask.setQueuedTime(Date.from(Instant.now())); ObjectMapper mapper = new ObjectMapper(); String serializedTask = mapper.writeValueAsString(responseTask); setupMocks(serializedTask, HttpStatus.SC_CREATED); ProjectApi projectApi = new ProjectRestApi(restClient); final CountDownLatch latch = new CountDownLatch(1); projectApi.deleteAsync("foo", new FutureCallback<Task>() { @Override public void onSuccess(@Nullable Task result) { assertEquals(result, responseTask); latch.countDown(); } @Override public void onFailure(Throwable t) { fail(t.toString()); latch.countDown(); } }); assertThat(latch.await(COUNTDOWNLATCH_AWAIT_TIMEOUT, TimeUnit.SECONDS), is(true)); }