@Test public void isSuccess_shouldReturnTrueIfResponseCodeIsInThe200Range(){ assertThat(new TestApiResponse(200).isSuccess(), equalTo(true)); assertThat(new TestApiResponse(201).isSuccess(), equalTo(true)); assertThat(new TestApiResponse(299).isSuccess(), equalTo(true)); }
public boolean isSuccess() { return (httpResponseCode /100==2); }
ApiResponse { public boolean isSuccess() { return (httpResponseCode /100==2); } }
ApiResponse { public boolean isSuccess() { return (httpResponseCode /100==2); } ApiResponse(int httpCode);  ApiResponse(int httpCode, Map<String, List<String>> headers); }
ApiResponse { public boolean isSuccess() { return (httpResponseCode /100==2); } ApiResponse(int httpCode);  ApiResponse(int httpCode, Map<String, List<String>> headers); abstract void consumeResponse(InputStream responseBody); int getHttpResponseCode(); Map<String, List<String>> getHeaders(); boolean isSuccess(); boolean isUnauthorized(); }
ApiResponse { public boolean isSuccess() { return (httpResponseCode /100==2); } ApiResponse(int httpCode);  ApiResponse(int httpCode, Map<String, List<String>> headers); abstract void consumeResponse(InputStream responseBody); int getHttpResponseCode(); Map<String, List<String>> getHeaders(); boolean isSuccess(); boolean isUnauthorized();  }