@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));
}