@Test
public void generatesFailureOn5XXResponse() throws Exception {

    for(int i = 500; i <= 599; i++) {
        resp = new BasicHttpResponse(HttpVersion.HTTP_1_1, i, "Server Error");
        backend.setResponse(resp);
        try {
            impl.execute(host, req, ctx);
            fail("should have thrown exception");
        } catch (UnsuccessfulResponseException expected) {
        }
    }
}