@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); DisksApi disksApi = new DisksRestApi(restClient); final CountDownLatch latch = new CountDownLatch(1); disksApi.deleteAsync("persistentDisk", 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));; }
@Override public void deleteAsync(final String diskId, final FutureCallback<Task> responseCallback) throws IOException { deleteObjectAsync(diskId, responseCallback); }
DisksRestApi extends ApiBase implements DisksApi { @Override public void deleteAsync(final String diskId, final FutureCallback<Task> responseCallback) throws IOException { deleteObjectAsync(diskId, responseCallback); } }
DisksRestApi extends ApiBase implements DisksApi { @Override public void deleteAsync(final String diskId, final FutureCallback<Task> responseCallback) throws IOException { deleteObjectAsync(diskId, responseCallback); } DisksRestApi(RestClient restClient); }
DisksRestApi extends ApiBase implements DisksApi { @Override public void deleteAsync(final String diskId, final FutureCallback<Task> responseCallback) throws IOException { deleteObjectAsync(diskId, responseCallback); } DisksRestApi(RestClient restClient); @Override String getBasePath(); @Override PersistentDisk getDisk(String diskId); @Override void getDiskAsync(final String diskId, final FutureCallback<PersistentDisk> responseCallback); @Override ResourceList<Task> getTasksForDisk(String diskId); @Override void getTasksForDiskAsync(final String diskId, final FutureCallback<ResourceList<Task>> responseCallback); @Override Task delete(String diskId); @Override void deleteAsync(final String diskId, final FutureCallback<Task> responseCallback); }
DisksRestApi extends ApiBase implements DisksApi { @Override public void deleteAsync(final String diskId, final FutureCallback<Task> responseCallback) throws IOException { deleteObjectAsync(diskId, responseCallback); } DisksRestApi(RestClient restClient); @Override String getBasePath(); @Override PersistentDisk getDisk(String diskId); @Override void getDiskAsync(final String diskId, final FutureCallback<PersistentDisk> responseCallback); @Override ResourceList<Task> getTasksForDisk(String diskId); @Override void getTasksForDiskAsync(final String diskId, final FutureCallback<ResourceList<Task>> responseCallback); @Override Task delete(String diskId); @Override void deleteAsync(final String diskId, final FutureCallback<Task> responseCallback);  }