From 0287fb565b53dec95bbd80cfa610c4f0940a1e87 Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Sun, 12 May 2019 12:25:50 +0800 Subject: [PATCH] =?UTF-8?q?#698=20=E4=BC=81=E4=B8=9A=E5=BE=AE=E4=BF=A1OA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3=E5=8D=95=E5=85=83=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cp/api/impl/WxCpOAServiceImplTest.java | 42 ++++++------------- 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpOAServiceImplTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpOAServiceImplTest.java index 1dff5366..9497a562 100644 --- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpOAServiceImplTest.java +++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpOAServiceImplTest.java @@ -1,5 +1,6 @@ package me.chanjar.weixin.cp.api.impl; +import com.google.common.collect.Lists; import com.google.gson.Gson; import com.google.inject.Inject; import me.chanjar.weixin.common.error.WxErrorException; @@ -16,52 +17,33 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; +import static org.assertj.core.api.Assertions.assertThat; + /** * @author Element - * @Package me.chanjar.weixin.cp.api.impl * @date 2019-04-20 13:46 - * @Description: TODO */ - @Guice(modules = ApiTestModule.class) public class WxCpOAServiceImplTest { - @Inject protected WxCpService wxService; - @Inject - protected Gson gson; - @Test public void testGetCheckinData() throws ParseException, WxErrorException { - Date starttime,endtime; - List userLists = new ArrayList<>(); - - starttime = DateFormatUtils.ISO_8601_EXTENDED_DATE_FORMAT.parse("2019-01-01"); - endtime = DateFormatUtils.ISO_8601_EXTENDED_DATE_FORMAT.parse("2019-01-20"); + Date startTime = DateFormatUtils.ISO_8601_EXTENDED_DATE_FORMAT.parse("2019-04-11"); + Date endTime = DateFormatUtils.ISO_8601_EXTENDED_DATE_FORMAT.parse("2019-05-10"); - userLists.add("1"); - userLists.add("2"); - userLists.add("3"); - - List results = wxService.getOAService().getCheckinData(1, starttime,endtime,userLists); - - System.out.println("results "); - System.out.println(gson.toJson(results)); + List results = wxService.getOAService() + .getCheckinData(1, startTime, endTime, Lists.newArrayList("binary")); + assertThat(results).isNotNull(); } @Test - public void testGetCheckinOption() throws WxErrorException{ - + public void testGetCheckinOption() throws WxErrorException { Date now = new Date(); - List userLists = new ArrayList<>(); - - userLists.add("user@aliyun.com"); - - List results = wxService.getOAService().getCheckinOption(now,userLists); - - System.out.println("results "); - System.out.println(gson.toJson(results)); + List results = wxService.getOAService() + .getCheckinOption(now, Lists.newArrayList("binary")); + assertThat(results).isNotNull(); } }