@Test public void testGetResourceTicket() throws IOException { 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); ResourceTicket response = resourceTicketApi.getResourceTicket("foo"); assertEquals(response, resourceTicket1); }
@Override public ResourceTicket getResourceTicket(String resourceTicketId) throws IOException { String path = String.format("%s/%s", getBasePath(), resourceTicketId); HttpResponse httpResponse = this.restClient.perform(RestClient.Method.GET, path, null); this.restClient.checkResponse(httpResponse, HttpStatus.SC_OK); return this.restClient.parseHttpResponse( httpResponse, new TypeReference<ResourceTicket>() { } ); }
ResourceTicketRestApi extends ApiBase implements ResourceTicketApi { @Override public ResourceTicket getResourceTicket(String resourceTicketId) throws IOException { String path = String.format("%s/%s", getBasePath(), resourceTicketId); HttpResponse httpResponse = this.restClient.perform(RestClient.Method.GET, path, null); this.restClient.checkResponse(httpResponse, HttpStatus.SC_OK); return this.restClient.parseHttpResponse( httpResponse, new TypeReference<ResourceTicket>() { } ); } }
ResourceTicketRestApi extends ApiBase implements ResourceTicketApi { @Override public ResourceTicket getResourceTicket(String resourceTicketId) throws IOException { String path = String.format("%s/%s", getBasePath(), resourceTicketId); HttpResponse httpResponse = this.restClient.perform(RestClient.Method.GET, path, null); this.restClient.checkResponse(httpResponse, HttpStatus.SC_OK); return this.restClient.parseHttpResponse( httpResponse, new TypeReference<ResourceTicket>() { } ); } ResourceTicketRestApi(RestClient restClient); }
ResourceTicketRestApi extends ApiBase implements ResourceTicketApi { @Override public ResourceTicket getResourceTicket(String resourceTicketId) throws IOException { String path = String.format("%s/%s", getBasePath(), resourceTicketId); HttpResponse httpResponse = this.restClient.perform(RestClient.Method.GET, path, null); this.restClient.checkResponse(httpResponse, HttpStatus.SC_OK); return this.restClient.parseHttpResponse( httpResponse, 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 ResourceTicket getResourceTicket(String resourceTicketId) throws IOException { String path = String.format("%s/%s", getBasePath(), resourceTicketId); HttpResponse httpResponse = this.restClient.perform(RestClient.Method.GET, path, null); this.restClient.checkResponse(httpResponse, HttpStatus.SC_OK); return this.restClient.parseHttpResponse( httpResponse, 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);  }