|
1 | 1 | package me.chanjar.weixin.cp.api.impl;
|
2 | 2 |
|
| 3 | +import com.google.common.collect.Lists; |
3 | 4 | import com.google.gson.Gson;
|
4 | 5 | import com.google.inject.Inject;
|
5 | 6 | import me.chanjar.weixin.common.error.WxErrorException;
|
|
16 | 17 | import java.util.Date;
|
17 | 18 | import java.util.List;
|
18 | 19 |
|
| 20 | +import static org.assertj.core.api.Assertions.assertThat; |
| 21 | + |
19 | 22 | /**
|
20 | 23 | * @author Element
|
21 |
| - * @Package me.chanjar.weixin.cp.api.impl |
22 | 24 | * @date 2019-04-20 13:46
|
23 |
| - * @Description: TODO |
24 | 25 | */
|
25 |
| - |
26 | 26 | @Guice(modules = ApiTestModule.class)
|
27 | 27 | public class WxCpOAServiceImplTest {
|
28 |
| - |
29 | 28 | @Inject
|
30 | 29 | protected WxCpService wxService;
|
31 | 30 |
|
32 |
| - @Inject |
33 |
| - protected Gson gson; |
34 |
| - |
35 | 31 | @Test
|
36 | 32 | public void testGetCheckinData() throws ParseException, WxErrorException {
|
37 |
| - Date starttime,endtime; |
38 |
| - List<String> userLists = new ArrayList<>(); |
39 |
| - |
40 |
| - starttime = DateFormatUtils.ISO_8601_EXTENDED_DATE_FORMAT.parse("2019-01-01"); |
41 |
| - endtime = DateFormatUtils.ISO_8601_EXTENDED_DATE_FORMAT.parse("2019-01-20"); |
| 33 | + Date startTime = DateFormatUtils.ISO_8601_EXTENDED_DATE_FORMAT.parse("2019-04-11"); |
| 34 | + Date endTime = DateFormatUtils.ISO_8601_EXTENDED_DATE_FORMAT.parse("2019-05-10"); |
42 | 35 |
|
43 |
| - userLists.add("1"); |
44 |
| - userLists.add("2"); |
45 |
| - userLists.add("3"); |
46 |
| - |
47 |
| - List<WxCpCheckinData> results = wxService.getOAService().getCheckinData(1, starttime,endtime,userLists); |
48 |
| - |
49 |
| - System.out.println("results "); |
50 |
| - System.out.println(gson.toJson(results)); |
| 36 | + List<WxCpCheckinData> results = wxService.getOAService() |
| 37 | + .getCheckinData(1, startTime, endTime, Lists.newArrayList("binary")); |
51 | 38 |
|
| 39 | + assertThat(results).isNotNull(); |
52 | 40 | }
|
53 | 41 |
|
54 | 42 | @Test
|
55 |
| - public void testGetCheckinOption() throws WxErrorException{ |
56 |
| - |
| 43 | + public void testGetCheckinOption() throws WxErrorException { |
57 | 44 | Date now = new Date();
|
58 |
| - List<String> userLists = new ArrayList<>(); |
59 |
| - |
60 |
| - userLists. add( "[email protected]"); |
61 |
| - |
62 |
| - List<WxCpCheckinOption> results = wxService.getOAService().getCheckinOption(now,userLists); |
63 |
| - |
64 |
| - System.out.println("results "); |
65 |
| - System.out.println(gson.toJson(results)); |
| 45 | + List<WxCpCheckinOption> results = wxService.getOAService() |
| 46 | + .getCheckinOption(now, Lists.newArrayList("binary")); |
| 47 | + assertThat(results).isNotNull(); |
66 | 48 | }
|
67 | 49 | }
|
0 commit comments