@Test public void getStatusCodeReturn404WhenHttpURLConnectionReturn404() throws Exception { HttpURLConnection connection = mock(HttpURLConnection.class); when(connection.getResponseCode()).thenReturn(404); HttpResponse httpResponse = new HttpResponse(connection); assertThat(httpResponse.getStatusCode(), is(404)); }
public int getStatusCode() throws IOException { return statusCode; }
HttpResponse { public int getStatusCode() throws IOException { return statusCode; } }
HttpResponse { public int getStatusCode() throws IOException { return statusCode; } HttpResponse(HttpURLConnection httpURLConnection); }
HttpResponse { public int getStatusCode() throws IOException { return statusCode; } HttpResponse(HttpURLConnection httpURLConnection); int getStatusCode(); InputStream getInputStream(); String getContent(); void disconnect(); }
HttpResponse { public int getStatusCode() throws IOException { return statusCode; } HttpResponse(HttpURLConnection httpURLConnection); int getStatusCode(); InputStream getInputStream(); String getContent(); void disconnect();  }