@Test
public void shouldThrowExceptionFor400PlusResponseStatus() throws Exception {

    Response response = mock(Response.class);
    when(response.getStatusCode()).thenReturn(123);
    when(response.to(String.class)).thenReturn("hello");
    try {
        toTest.handle(response);
        fail();
    } catch (CRestException e) {
        assertEquals("Response Status Code:123\nResponse: hello", e.getMessage());
    }
}