@Test
public void shouldReadJsonResponse_ioException() throws Exception {

    // Given
    final ObjectMapper mapper = new ObjectMapper();
    final BasicHttpResponse httpResponse = buildResponse();
    httpResponse.setEntity(new StringEntity("") {
        @Override
        public InputStream getContent() throws IOException {
            throw new IOException();
        }
    });
    // When
    try {
        Defaults.convertResponse(mapper, Response.class).apply(buildRequest(), httpResponse);
    } catch (TDPException e) {
        // Then
        assertEquals(CommonErrorCodes.UNEXPECTED_EXCEPTION, e.getCode());
    }
}