    @Test
    public void errorResponseThrowsHttpError() throws Exception {

        given(connection.getURL()).willReturn(new URL(URL));
        given(connection.getResponseCode()).willReturn(400);
        Map<String, List<String>> responseHeaderFields = new LinkedHashMap<String, List<String>>();
        given(connection.getHeaderFields()).willReturn(responseHeaderFields, Collections.<String, List<String>> emptyMap());

        Request request = new Request("GET", URL, Collections.<Header> emptyList(), null);

        Response response = underTest.execute(request);

        assertThat(response.getStatus()).isEqualTo(400);
    }