use of org.xwiki.rest.model.jaxb.Wikis in project xwiki-platform by xwiki.
the class WikisResourceTest method testRepresentation.
@Override
@Test
public void testRepresentation() throws Exception {
GetMethod getMethod = executeGet(getFullUri(WikisResource.class));
Assert.assertEquals(getHttpMethodInfo(getMethod), HttpStatus.SC_OK, getMethod.getStatusCode());
Wikis wikis = (Wikis) unmarshaller.unmarshal(getMethod.getResponseBodyAsStream());
Assert.assertTrue(getHttpMethodInfo(getMethod), wikis.getWikis().size() > 0);
for (Wiki wiki : wikis.getWikis()) {
Link link = getFirstLinkByRelation(wiki, Relations.SPACES);
Assert.assertNotNull(link);
link = getFirstLinkByRelation(wiki, Relations.CLASSES);
Assert.assertNotNull(link);
link = getFirstLinkByRelation(wiki, Relations.MODIFICATIONS);
Assert.assertNotNull(link);
link = getFirstLinkByRelation(wiki, Relations.SEARCH);
Assert.assertNotNull(link);
link = getFirstLinkByRelation(wiki, Relations.QUERY);
Assert.assertNotNull(link);
checkLinks(wiki);
}
}
use of org.xwiki.rest.model.jaxb.Wikis in project xwiki-platform by xwiki.
the class AbstractHttpTest method getWiki.
protected String getWiki() throws Exception {
GetMethod getMethod = executeGet(getFullUri(WikisResource.class));
Assert.assertEquals(getHttpMethodInfo(getMethod), HttpStatus.SC_OK, getMethod.getStatusCode());
Wikis wikis = (Wikis) unmarshaller.unmarshal(getMethod.getResponseBodyAsStream());
Assert.assertTrue(wikis.getWikis().size() > 0);
return wikis.getWikis().get(0).getName();
}
Aggregations