MediaType.APPLICATION_ATOM_XML);
MockHttpServletResponse response = invoke(request);
assertEquals(200, response.getStatus());
Unmarshaller u =
JAXBContext.newInstance(AtomEntry.class.getPackage().getName()).createUnmarshaller();
AtomFeed feed =
((JAXBElement<AtomFeed>)u.unmarshal(new ByteArrayInputStream(response
.getContentAsByteArray()))).getValue();
assertEquals("Report Definitions Collection", feed.getTitle().getValue());
assertEquals("Collection of report definitions. Report definition is a XML document describing how to build the report. It describes data sources, data sets, business logic and rendering and report parameters. Report definitions may also use libraries.",
feed.getSubtitle().getValue());
assertEquals("http://b216:8080/reporting/reports/?start-index=0&max-results=30&alt=text/plain",
feed.getLinks().get(0).getHref());
assertEquals("first", feed.getLinks().get(0).getRel());
assertEquals("http://b216:8080/reporting/reports?alt=application/json", feed.getLinks()
.get(1).getHref());
assertEquals("alternate", feed.getLinks().get(1).getRel());
assertEquals("http://b216:8080/reporting/reports", feed.getLinks().get(2).getHref());
assertEquals("self", feed.getLinks().get(2).getRel());
assertEquals("admin", feed.getAuthors().get(0).getName());
assertEquals("urn:com:systinet:reporting:kind", feed.getCategories().get(0).getScheme());
assertEquals("urn:com:systinet:reporting:kind:definitions:collection", feed.getCategories()
.get(0).getTerm());
assertEquals("report definitions", feed.getCategories().get(0).getLabel());
AtomEntry entry = feed.getEntries().get(0);
assertEquals("toptenvalidators", entry.getId());
assertEquals("top ten validators", entry.getTitle().getValue());
assertEquals("http://b216:8080/reporting/reports/toptenvalidators?alt=application/json",
entry.getLinks().get(0).getHref());
assertEquals("alternate", entry.getLinks().get(0).getRel());