@Test(expected = RuntimeException.class) public void entityAsStringThrowsRuntimeExceptionOnIOException() throws IllegalStateException, IOException { when(entity.getContent()).thenThrow(new IOException()); exception.getEntityAsString(); }
public String getEntityAsString() { try { return EntityUtils.toString(entity, "UTF-8"); } catch (IOException ex) { throw new RuntimeException(ex); } }
FailedHttpResponseException extends RuntimeException { public String getEntityAsString() { try { return EntityUtils.toString(entity, "UTF-8"); } catch (IOException ex) { throw new RuntimeException(ex); } } }
FailedHttpResponseException extends RuntimeException { public String getEntityAsString() { try { return EntityUtils.toString(entity, "UTF-8"); } catch (IOException ex) { throw new RuntimeException(ex); } } FailedHttpResponseException(int statusCode, HttpEntity entity); }
FailedHttpResponseException extends RuntimeException { public String getEntityAsString() { try { return EntityUtils.toString(entity, "UTF-8"); } catch (IOException ex) { throw new RuntimeException(ex); } } FailedHttpResponseException(int statusCode, HttpEntity entity); int getStatusCode(); HttpEntity getEntity(); String getEntityAsString(); }
FailedHttpResponseException extends RuntimeException { public String getEntityAsString() { try { return EntityUtils.toString(entity, "UTF-8"); } catch (IOException ex) { throw new RuntimeException(ex); } } FailedHttpResponseException(int statusCode, HttpEntity entity); int getStatusCode(); HttpEntity getEntity(); String getEntityAsString();  }