44import me .chanjar .weixin .common .api .WxConsts ;
55import me .chanjar .weixin .common .bean .result .WxMediaUploadResult ;
66import me .chanjar .weixin .common .exception .WxErrorException ;
7+ import me .chanjar .weixin .common .session .WxSession ;
78import me .chanjar .weixin .mp .bean .WxMpMassGroupMessage ;
89import me .chanjar .weixin .mp .bean .WxMpMassNews ;
910import me .chanjar .weixin .mp .bean .WxMpMassOpenIdsMessage ;
1011import me .chanjar .weixin .mp .bean .WxMpMassVideo ;
1112import me .chanjar .weixin .mp .bean .result .WxMpMassSendResult ;
1213import me .chanjar .weixin .mp .bean .result .WxMpMassUploadResult ;
14+ import me .chanjar .weixin .mp .bean .result .WxMpUserCumulate ;
15+ import me .chanjar .weixin .mp .bean .result .WxMpUserSummary ;
1316import org .testng .Assert ;
1417import org .testng .annotations .DataProvider ;
1518import org .testng .annotations .Guice ;
1619import org .testng .annotations .Test ;
1720
1821import java .io .IOException ;
1922import java .io .InputStream ;
23+ import java .text .ParseException ;
24+ import java .text .SimpleDateFormat ;
2025import java .util .Arrays ;
26+ import java .util .Date ;
27+ import java .util .List ;
2128
2229/**
2330 *
@@ -32,11 +39,31 @@ public class WxMpMiscAPITest {
3239 protected WxMpServiceImpl wxService ;
3340
3441 @ Test
35- public void getCallbackIP () throws WxErrorException {
42+ public void testGetCallbackIP () throws WxErrorException {
3643 String [] ipArray = wxService .getCallbackIP ();
3744 System .out .println (Arrays .toString (ipArray ));
3845 Assert .assertNotNull (ipArray );
3946 Assert .assertNotEquals (ipArray .length , 0 );
4047 }
4148
49+ @ Test
50+ public void testGetUserSummary () throws WxErrorException , ParseException {
51+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat ("yyyy-MM-dd" );
52+ Date beginDate = simpleDateFormat .parse ("2015-01-01" );
53+ Date endDate = simpleDateFormat .parse ("2015-01-02" );
54+ List <WxMpUserSummary > summaries = wxService .getUserSummary (beginDate , endDate );
55+ System .out .println (summaries );
56+ Assert .assertNotNull (summaries );
57+ }
58+
59+ @ Test
60+ public void testGetUserCumulate () throws WxErrorException , ParseException {
61+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat ("yyyy-MM-dd" );
62+ Date beginDate = simpleDateFormat .parse ("2015-01-01" );
63+ Date endDate = simpleDateFormat .parse ("2015-01-02" );
64+ List <WxMpUserCumulate > cumulates = wxService .getUserCumulate (beginDate , endDate );
65+ System .out .println (cumulates );
66+ Assert .assertNotNull (cumulates );
67+ }
68+
4269}
0 commit comments