@Test(expectedExceptions = J4pException.class,expectedExceptionsMessageRegExp = ".*reading.*response.*")
public void throwIOExceptionWhenParsingAnswer() throws IOException, J4pException {

    HttpClient client = createMock(HttpClient.class);
    HttpResponse response  = createMock(HttpResponse.class);
    HttpEntity entity = createMock(HttpEntity.class);
    expect(client.execute(EasyMock.<HttpUriRequest>anyObject())).andReturn(response);
    expect(response.getEntity()).andReturn(entity);
    expect(entity.getContentEncoding()).andReturn(null);
    expect(entity.isStreaming()).andReturn(false);
    expect(entity.getContent()).andThrow(new IOException());
    replay(client, entity, response);
    J4pClient j4p = new J4pClient(TEST_URL,client);
    j4p.execute(TEST_REQUEST);
}