@Test public void entityAsStringReturnsCorrectly() throws IllegalStateException, IOException { InputStream content = new ByteArrayInputStream("testContent".getBytes("UTF-8")); when(entity.getContent()).thenReturn(content); assertEquals("testContent", 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();  }