SystemStatusRestApi extends ApiBase implements SystemStatusApi { @Override public SystemStatus getSystemStatus() 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<SystemStatus>() { } ); } SystemStatusRestApi(RestClient restClient); @Override String getBasePath(); @Override SystemStatus getSystemStatus(); @Override void getSystemStatusAsync(final FutureCallback<SystemStatus> responseCallback);  }
@Test public void testGetSystemStatus() throws IOException { SystemStatus systemStatus = new SystemStatus(); systemStatus.setStatus(StatusType.READY); ObjectMapper mapper = new ObjectMapper(); String serialized = mapper.writeValueAsString(systemStatus); setupMocks(serialized, HttpStatus.SC_OK); SystemStatusApi systemStatusApi = new SystemStatusRestApi(restClient); SystemStatus response = systemStatusApi.getSystemStatus(); assertEquals(response, systemStatus); }