1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.test.rest; |
21 |
|
|
22 |
|
import org.apache.commons.httpclient.HttpStatus; |
23 |
|
import org.apache.commons.httpclient.methods.GetMethod; |
24 |
|
import org.junit.Assert; |
25 |
|
import org.junit.Test; |
26 |
|
import org.xwiki.rest.Relations; |
27 |
|
import org.xwiki.rest.model.jaxb.Link; |
28 |
|
import org.xwiki.rest.model.jaxb.Xwiki; |
29 |
|
import org.xwiki.rest.resources.RootResource; |
30 |
|
import org.xwiki.test.rest.framework.AbstractHttpTest; |
31 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.12 |
|
32 |
|
public class RootResourceTest extends AbstractHttpTest |
33 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
1PASS
|
|
34 |
1 |
@Override... |
35 |
|
@Test |
36 |
|
public void testRepresentation() throws Exception |
37 |
|
{ |
38 |
1 |
GetMethod getMethod = executeGet(getFullUri(RootResource.class)); |
39 |
1 |
Assert.assertEquals(getHttpMethodInfo(getMethod), HttpStatus.SC_OK, getMethod.getStatusCode()); |
40 |
|
|
41 |
1 |
Xwiki xwiki = (Xwiki) unmarshaller.unmarshal(getMethod.getResponseBodyAsStream()); |
42 |
|
|
43 |
1 |
Link link = getFirstLinkByRelation(xwiki, Relations.WIKIS); |
44 |
1 |
Assert.assertNotNull(link); |
45 |
|
|
46 |
1 |
link = getFirstLinkByRelation(xwiki, Relations.SYNTAXES); |
47 |
1 |
Assert.assertNotNull(link); |
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
1 |
checkLinks(xwiki); |
53 |
|
} |
54 |
|
} |