@Test
public void getStatusCodeReturn200WhenHttpURLConnectionReturn200() throws Exception {

    HttpURLConnection connection = mock(HttpURLConnection.class);
    when(connection.getResponseCode()).thenReturn(200);
    HttpResponse httpResponse = new HttpResponse(connection);
    assertThat(httpResponse.getStatusCode(), is(200));
}