IOException ioe = new IOException("fake io exception");
RuntimeException re = new RuntimeException("oops", ioe);
ResponseBuilder bldr = cem.getDefaultBuilder(re, null,
MediaType.APPLICATION_ATOM_XML_TYPE);
Response r = bldr.build();
ExceptionMessage em = (ExceptionMessage) r.getEntity();
assertEquals(Status.INTERNAL_SERVER_ERROR.getStatusCode(), r.getStatus());
assertEquals(MediaType.APPLICATION_ATOM_XML_TYPE,
r.getMetadata().get("Content-Type").get(0));
assertTrue(em.getDisplayMessage().startsWith("Runtime Error " + re.getMessage()));
}