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.macro.dashboard; |
21 |
|
|
22 |
|
import java.util.Arrays; |
23 |
|
import java.util.Collections; |
24 |
|
import java.util.List; |
25 |
|
|
26 |
|
import org.junit.Rule; |
27 |
|
import org.junit.Test; |
28 |
|
import org.xwiki.rendering.block.Block; |
29 |
|
import org.xwiki.rendering.block.MacroMarkerBlock; |
30 |
|
import org.xwiki.test.mockito.MockitoComponentMockingRule; |
31 |
|
|
32 |
|
import static org.junit.Assert.*; |
33 |
|
|
34 |
|
|
35 |
|
@link |
36 |
|
|
37 |
|
@version |
38 |
|
@since |
39 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 3 |
Complexity Density: 0.5 |
|
40 |
|
public class EmptyXDOMCheckerTest |
41 |
|
{ |
42 |
|
@Rule |
43 |
|
public MockitoComponentMockingRule<EmptyXDOMChecker> mocker = |
44 |
|
new MockitoComponentMockingRule<>(EmptyXDOMChecker.class); |
45 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1PASS
|
|
46 |
1 |
@Test... |
47 |
|
public void checkWhenSingleMacroMarkerBlock() throws Exception |
48 |
|
{ |
49 |
1 |
List<Block> blocks = Collections.singletonList( |
50 |
|
new MacroMarkerBlock("macro", Collections.emptyMap(), Collections.emptyList(), false)); |
51 |
|
|
52 |
1 |
assertTrue(this.mocker.getComponentUnderTest().check(blocks)); |
53 |
|
} |
54 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1PASS
|
|
55 |
1 |
@Test... |
56 |
|
public void checkWhenTwoMacroMarkerBlock() throws Exception |
57 |
|
{ |
58 |
1 |
List<Block> blocks = Arrays.asList( |
59 |
|
new MacroMarkerBlock("macro", Collections.emptyMap(), Collections.emptyList(), false), |
60 |
|
new MacroMarkerBlock("macro2", Collections.emptyMap(), Collections.emptyList(), false) |
61 |
|
); |
62 |
|
|
63 |
1 |
assertTrue(this.mocker.getComponentUnderTest().check(blocks)); |
64 |
|
} |
65 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1PASS
|
|
66 |
1 |
@Test... |
67 |
|
public void checkWhenNoBlock() throws Exception |
68 |
|
{ |
69 |
1 |
List<Block> blocks = Collections.emptyList(); |
70 |
1 |
assertTrue(this.mocker.getComponentUnderTest().check(blocks)); |
71 |
|
} |
72 |
|
} |