AuthRestApi extends ApiBase implements AuthApi { @Override public Auth getAuthStatus() throws IOException { String path = getBasePath(); HttpResponse httpResponse = this.restClient.perform(RestClient.Method.GET, path, null); this.restClient.checkResponse(httpResponse, HttpStatus.SC_OK); return this.restClient.parseHttpResponse(httpResponse, new TypeReference<Auth>() { }); } AuthRestApi(RestClient restClient); @Override String getBasePath(); @Override Auth getAuthStatus(); @Override void getAuthStatusAsync(final FutureCallback<Auth> responseCallback);  }
@Test public void testGetAuthStatus() throws IOException { final Auth auth = new Auth(); ObjectMapper mapper = new ObjectMapper(); String serialized = mapper.writeValueAsString(auth); setupMocks(serialized, HttpStatus.SC_OK); AuthApi authApi = new AuthRestApi(restClient); Auth response = authApi.getAuthStatus(); assertEquals(response, auth); }