@Test(expectedExceptions = IOException.class) public void testGetTaskAsyncThrowsException() throws IOException { setupMocksToThrow(new IOException()); TasksApi tasksApi = new TasksRestApi(this.restClient); tasksApi.getTaskAsync("foo", new FutureCallback<Task>() { @Override public void onSuccess(@Nullable Task task) { fail("Unexpected success invoking api"); } @Override public void onFailure(Throwable t) { fail("Unexpected exception invoking api"); } }); fail("Unexpected success invoking api"); }
@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);  }