1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.filter.internal; |
21 |
|
|
22 |
|
import org.junit.Assert; |
23 |
|
import org.junit.Rule; |
24 |
|
import org.junit.Test; |
25 |
|
import org.xwiki.filter.internal.type.FilterStreamTypeConverter; |
26 |
|
import org.xwiki.filter.type.FilterStreamType; |
27 |
|
import org.xwiki.properties.converter.Converter; |
28 |
|
import org.xwiki.test.mockito.MockitoComponentMockingRule; |
29 |
|
|
30 |
|
|
31 |
|
@link |
32 |
|
|
33 |
|
@version |
34 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (12) |
Complexity: 4 |
Complexity Density: 0.5 |
|
35 |
|
public class FilterStreamTypeConverterTest |
36 |
|
{ |
37 |
|
@Rule |
38 |
|
public MockitoComponentMockingRule<Converter<FilterStreamType>> mocker = |
39 |
|
new MockitoComponentMockingRule<Converter<FilterStreamType>>(FilterStreamTypeConverter.class); |
40 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1PASS
|
|
41 |
1 |
@Test... |
42 |
|
public void convertToTypeObject() throws Exception |
43 |
|
{ |
44 |
1 |
FilterStreamType type = |
45 |
|
this.mocker.getComponentUnderTest().convert(FilterStreamType.class, |
46 |
|
FilterStreamType.XWIKI_XAR_CURRENT.serialize()); |
47 |
1 |
Assert.assertEquals(FilterStreamType.XWIKI_XAR_CURRENT, type); |
48 |
|
} |
49 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1PASS
|
|
50 |
1 |
@Test... |
51 |
|
public void convertToTypeObjectWhenNull() throws Exception |
52 |
|
{ |
53 |
1 |
FilterStreamType type = this.mocker.getComponentUnderTest().convert(FilterStreamType.class, null); |
54 |
1 |
Assert.assertNull(type); |
55 |
|
} |
56 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1PASS
|
|
57 |
1 |
@Test... |
58 |
|
public void convertToString() throws Exception |
59 |
|
{ |
60 |
1 |
String typeId = this.mocker.getComponentUnderTest().convert(String.class, FilterStreamType.XWIKI_XAR_CURRENT); |
61 |
1 |
Assert.assertEquals(FilterStreamType.XWIKI_XAR_CURRENT.serialize(), typeId); |
62 |
|
} |
63 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1PASS
|
|
64 |
1 |
@Test... |
65 |
|
public void convertToStringWhenNull() throws Exception |
66 |
|
{ |
67 |
1 |
String typeId = this.mocker.getComponentUnderTest().convert(String.class, null); |
68 |
1 |
Assert.assertNull(typeId); |
69 |
|
} |
70 |
|
} |