@Test public void testGetTaskAsync() throws Throwable { 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_OK); TasksApi tasksApi = new TasksRestApi(this.restClient); tasksApi.getTaskAsync("foo", new FutureCallback<Task>() { @Override public void onSuccess(@Nullable Task task) { assertEquals(task, responseTask); } @Override public void onFailure(Throwable t) { fail(t.toString()); } }); }
@Override public void getTaskAsync(final String taskId, final FutureCallback<Task> responseCallback) throws IOException { String path = getBasePath() + "/" + taskId; getObjectByPathAsync(path, responseCallback, new TypeReference<Task>() { }); }
TasksRestApi extends ApiBase implements TasksApi { @Override public void getTaskAsync(final String taskId, final FutureCallback<Task> responseCallback) throws IOException { String path = getBasePath() + "/" + taskId; getObjectByPathAsync(path, responseCallback, new TypeReference<Task>() { }); } }
TasksRestApi extends ApiBase implements TasksApi { @Override public void getTaskAsync(final String taskId, final FutureCallback<Task> responseCallback) throws IOException { String path = getBasePath() + "/" + taskId; getObjectByPathAsync(path, responseCallback, new TypeReference<Task>() { }); } TasksRestApi(RestClient restClient); }
TasksRestApi extends ApiBase implements TasksApi { @Override public void getTaskAsync(final String taskId, final FutureCallback<Task> responseCallback) throws IOException { String path = getBasePath() + "/" + taskId; getObjectByPathAsync(path, responseCallback, new TypeReference<Task>() { }); } TasksRestApi(RestClient restClient); @Override String getBasePath(); @Override Task getTask(final String taskId); @Override void getTaskAsync(final String taskId, final FutureCallback<Task> responseCallback); }
TasksRestApi extends ApiBase implements TasksApi { @Override public void getTaskAsync(final String taskId, final FutureCallback<Task> responseCallback) throws IOException { String path = getBasePath() + "/" + taskId; getObjectByPathAsync(path, responseCallback, new TypeReference<Task>() { }); } TasksRestApi(RestClient restClient); @Override String getBasePath(); @Override Task getTask(final String taskId); @Override void getTaskAsync(final String taskId, final FutureCallback<Task> responseCallback);  }