1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.wiki.internal.configuration; |
21 |
|
|
22 |
|
import org.junit.Before; |
23 |
|
import org.junit.Rule; |
24 |
|
import org.junit.Test; |
25 |
|
import org.xwiki.configuration.ConfigurationSource; |
26 |
|
import org.xwiki.test.mockito.MockitoComponentMockingRule; |
27 |
|
|
28 |
|
import static org.junit.Assert.assertEquals; |
29 |
|
import static org.mockito.Mockito.when; |
30 |
|
|
31 |
|
|
32 |
|
@link |
33 |
|
|
34 |
|
@version |
35 |
|
@since |
36 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
37 |
|
public class DefaultWikiConfigurationTest |
38 |
|
{ |
39 |
|
@Rule |
40 |
|
public MockitoComponentMockingRule<DefaultWikiConfiguration> mocker = |
41 |
|
new MockitoComponentMockingRule(DefaultWikiConfiguration.class); |
42 |
|
|
43 |
|
private ConfigurationSource configuration; |
44 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
45 |
1 |
@Before... |
46 |
|
public void setUp() throws Exception |
47 |
|
{ |
48 |
1 |
configuration = mocker.getInstance(ConfigurationSource.class, "xwikiproperties"); |
49 |
|
} |
50 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1PASS
|
|
51 |
1 |
@Test... |
52 |
|
public void getAliasSuffix() throws Exception |
53 |
|
{ |
54 |
1 |
when(configuration.getProperty("wiki.alias.suffix", "")).thenReturn("xwiki.org"); |
55 |
1 |
assertEquals("xwiki.org", mocker.getComponentUnderTest().getAliasSuffix()); |
56 |
|
|
57 |
1 |
when(configuration.getProperty("wiki.alias.suffix", "")).thenReturn("blabla.org"); |
58 |
1 |
assertEquals("blabla.org", mocker.getComponentUnderTest().getAliasSuffix()); |
59 |
|
} |
60 |
|
} |