1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.url.internal.standard; |
21 |
|
|
22 |
|
import org.junit.*; |
23 |
|
import org.xwiki.configuration.ConfigurationSource; |
24 |
|
import org.xwiki.test.mockito.MockitoComponentMockingRule; |
25 |
|
|
26 |
|
import static org.junit.Assert.*; |
27 |
|
import static org.mockito.Mockito.*; |
28 |
|
|
29 |
|
|
30 |
|
@link |
31 |
|
|
32 |
|
@version |
33 |
|
@since |
34 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (16) |
Complexity: 4 |
Complexity Density: 0.33 |
|
35 |
|
public class DefaultStandardURLConfigurationTest |
36 |
|
{ |
37 |
|
@Rule |
38 |
|
public MockitoComponentMockingRule<DefaultStandardURLConfiguration> mocker = |
39 |
|
new MockitoComponentMockingRule<>(DefaultStandardURLConfiguration.class); |
40 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1PASS
|
|
41 |
1 |
@Test... |
42 |
|
public void isPathBasedMultiWiki() throws Exception |
43 |
|
{ |
44 |
1 |
ConfigurationSource source = this.mocker.getInstance(ConfigurationSource.class, "xwikiproperties"); |
45 |
1 |
when(source.getProperty("url.standard.multiwiki.isPathBased", Boolean.TRUE)).thenReturn(Boolean.TRUE); |
46 |
|
|
47 |
1 |
assertTrue(this.mocker.getComponentUnderTest().isPathBasedMultiWiki()); |
48 |
|
} |
49 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1PASS
|
|
50 |
1 |
@Test... |
51 |
|
public void getWikiPathPrefix() throws Exception |
52 |
|
{ |
53 |
1 |
ConfigurationSource source = this.mocker.getInstance(ConfigurationSource.class, "xwikiproperties"); |
54 |
1 |
when(source.getProperty("url.standard.multiwiki.wikiPathPrefix", "wiki")).thenReturn("wiki"); |
55 |
|
|
56 |
1 |
assertEquals("wiki", this.mocker.getComponentUnderTest().getWikiPathPrefix()); |
57 |
|
} |
58 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1PASS
|
|
59 |
1 |
@Test... |
60 |
|
public void getEntityPathPrefix() throws Exception |
61 |
|
{ |
62 |
1 |
ConfigurationSource source = this.mocker.getInstance(ConfigurationSource.class, "xwikiproperties"); |
63 |
1 |
when(source.getProperty("url.standard.entityPathPrefix", "bin")).thenReturn("bin"); |
64 |
|
|
65 |
1 |
assertEquals("bin", this.mocker.getComponentUnderTest().getEntityPathPrefix()); |
66 |
|
} |
67 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1PASS
|
|
68 |
1 |
@Test... |
69 |
|
public void isViewActionHidden() throws Exception |
70 |
|
{ |
71 |
1 |
ConfigurationSource source = this.mocker.getInstance(ConfigurationSource.class, "xwikiproperties"); |
72 |
1 |
when(source.getProperty("url.standard.hideViewAction", false)).thenReturn(false); |
73 |
|
|
74 |
1 |
assertFalse(this.mocker.getComponentUnderTest().isViewActionHidden()); |
75 |
|
} |
76 |
|
} |