1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.rendering.internal.transformation.icon; |
21 |
|
|
22 |
|
import java.util.Properties; |
23 |
|
|
24 |
|
import org.junit.Rule; |
25 |
|
import org.junit.Test; |
26 |
|
import org.xwiki.configuration.ConfigurationSource; |
27 |
|
import org.xwiki.test.mockito.MockitoComponentMockingRule; |
28 |
|
|
29 |
|
import static org.junit.Assert.*; |
30 |
|
import static org.mockito.Mockito.*; |
31 |
|
|
32 |
|
|
33 |
|
@link |
34 |
|
|
35 |
|
@version |
36 |
|
@since |
37 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.12 |
|
38 |
|
public class XWikiIconTransformationConfigurationTest |
39 |
|
{ |
40 |
|
@Rule |
41 |
|
public MockitoComponentMockingRule<XWikiIconTransformationConfiguration> mocker = |
42 |
|
new MockitoComponentMockingRule<>(XWikiIconTransformationConfiguration.class); |
43 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
1PASS
|
|
44 |
1 |
@Test... |
45 |
|
public void getMappings() throws Exception |
46 |
|
{ |
47 |
1 |
ConfigurationSource source = this.mocker.getInstance(ConfigurationSource.class); |
48 |
1 |
Properties props = new Properties(); |
49 |
1 |
props.setProperty("::", "test"); |
50 |
1 |
when(source.getProperty("rendering.transformation.icon.mappings", Properties.class)).thenReturn(props); |
51 |
|
|
52 |
1 |
Properties mappings = this.mocker.getComponentUnderTest().getMappings(); |
53 |
1 |
assertNotNull(mappings); |
54 |
|
|
55 |
1 |
assertTrue(mappings.size() > 1); |
56 |
1 |
assertEquals("test", mappings.getProperty("::")); |
57 |
|
} |
58 |
|
} |