@Test
public void shouldReturnString_handleIOError() throws Exception {

    // When
    final BasicHttpResponse response = buildResponse();
    response.setEntity(new StringEntity("") {
        @Override
        public InputStream getContent() throws IOException {
            throw new IOException("Unexpected exception");
        }
    });
    try {
        Defaults.asString().apply(buildRequest(), response);
    } catch (TDPException e) {
        // Then
        assertEquals(CommonErrorCodes.UNEXPECTED_EXCEPTION, e.getCode());
    }
}