1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.mail.internal; |
21 |
|
|
22 |
|
import java.util.LinkedHashMap; |
23 |
|
import java.util.Map; |
24 |
|
|
25 |
|
import org.junit.Rule; |
26 |
|
import org.junit.Test; |
27 |
|
import org.xwiki.test.mockito.MockitoComponentMockingRule; |
28 |
|
|
29 |
|
import static org.junit.Assert.*; |
30 |
|
|
31 |
|
|
32 |
|
@link |
33 |
|
|
34 |
|
@version |
35 |
|
@since |
36 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 2 |
Complexity Density: 0.25 |
|
37 |
|
public class DatabaseMailStatusStoreTest |
38 |
|
{ |
39 |
|
@Rule |
40 |
|
public MockitoComponentMockingRule<DatabaseMailStatusStore> mocker = |
41 |
|
new MockitoComponentMockingRule<>(DatabaseMailStatusStore.class); |
42 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1PASS
|
|
43 |
1 |
@Test... |
44 |
|
public void computeSelectQueryString() throws Exception |
45 |
|
{ |
46 |
1 |
Map<String, Object> filterMap = new LinkedHashMap<>(); |
47 |
1 |
filterMap.put("status", "failed"); |
48 |
1 |
filterMap.put("wiki", "mywiki"); |
49 |
|
|
50 |
1 |
assertEquals("from org.xwiki.mail.MailStatus where mail_status like :status and mail_wiki like :wiki order by date desc", |
51 |
|
this.mocker.getComponentUnderTest().computeSelectQueryString(filterMap, "date", false)); |
52 |
|
} |
53 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1PASS
|
|
54 |
1 |
@Test... |
55 |
|
public void computeCountQueryString() throws Exception |
56 |
|
{ |
57 |
1 |
Map<String, Object> filterMap = new LinkedHashMap<>(); |
58 |
1 |
filterMap.put("status", "failed"); |
59 |
1 |
filterMap.put("wiki", "mywiki"); |
60 |
|
|
61 |
1 |
assertEquals("select count(*) from org.xwiki.mail.MailStatus where mail_status like :status and " |
62 |
|
+ "mail_wiki like :wiki", this.mocker.getComponentUnderTest().computeCountQueryString(filterMap)); |
63 |
|
} |
64 |
|
} |