@Test public void testGetResourceTicketAsync() throws IOException, InterruptedException { final ResourceTicket resourceTicket1 = new ResourceTicket(); resourceTicket1.setId("resourceTicket1"); ObjectMapper mapper = new ObjectMapper(); String serializedTask = mapper.writeValueAsString(resourceTicket1); setupMocks(serializedTask, HttpStatus.SC_OK); ResourceTicketApi resourceTicketApi = new ResourceTicketRestApi(restClient); final CountDownLatch latch = new CountDownLatch(1); resourceTicketApi.getResourceTicketAsync("foo", new FutureCallback<ResourceTicket>() { @Override public void onSuccess(@Nullable ResourceTicket result) { assertEquals(result, resourceTicket1); 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 getResourceTicketAsync(final String resourceTicketId, final FutureCallback<ResourceTicket> responseCallback) throws IOException { final String path = String.format("%s/%s", getBasePath(), resourceTicketId); getObjectByPathAsync(path, responseCallback, new TypeReference<ResourceTicket>() { }); }
ResourceTicketRestApi extends ApiBase implements ResourceTicketApi { @Override public void getResourceTicketAsync(final String resourceTicketId, final FutureCallback<ResourceTicket> responseCallback) throws IOException { final String path = String.format("%s/%s", getBasePath(), resourceTicketId); getObjectByPathAsync(path, responseCallback, new TypeReference<ResourceTicket>() { }); } }
ResourceTicketRestApi extends ApiBase implements ResourceTicketApi { @Override public void getResourceTicketAsync(final String resourceTicketId, final FutureCallback<ResourceTicket> responseCallback) throws IOException { final String path = String.format("%s/%s", getBasePath(), resourceTicketId); getObjectByPathAsync(path, responseCallback, new TypeReference<ResourceTicket>() { }); } ResourceTicketRestApi(RestClient restClient); }
ResourceTicketRestApi extends ApiBase implements ResourceTicketApi { @Override public void getResourceTicketAsync(final String resourceTicketId, final FutureCallback<ResourceTicket> responseCallback) throws IOException { final String path = String.format("%s/%s", getBasePath(), resourceTicketId); getObjectByPathAsync(path, responseCallback, new TypeReference<ResourceTicket>() { }); } ResourceTicketRestApi(RestClient restClient); @Override String getBasePath(); @Override ResourceTicket getResourceTicket(String resourceTicketId); @Override void getResourceTicketAsync(final String resourceTicketId, final FutureCallback<ResourceTicket>
      responseCallback); @Override ResourceList<Task> getTasksForResourceTicket(String resourceTicketId); @Override void getTasksForResourceTicketAsync(final String resourceTicketId, final FutureCallback<ResourceList<Task>>
      responseCallback); }
ResourceTicketRestApi extends ApiBase implements ResourceTicketApi { @Override public void getResourceTicketAsync(final String resourceTicketId, final FutureCallback<ResourceTicket> responseCallback) throws IOException { final String path = String.format("%s/%s", getBasePath(), resourceTicketId); getObjectByPathAsync(path, responseCallback, new TypeReference<ResourceTicket>() { }); } ResourceTicketRestApi(RestClient restClient); @Override String getBasePath(); @Override ResourceTicket getResourceTicket(String resourceTicketId); @Override void getResourceTicketAsync(final String resourceTicketId, final FutureCallback<ResourceTicket>
      responseCallback); @Override ResourceList<Task> getTasksForResourceTicket(String resourceTicketId); @Override void getTasksForResourceTicketAsync(final String resourceTicketId, final FutureCallback<ResourceList<Task>>
      responseCallback);  }