| @@ -1,5 +1,6 @@ | |||||
| package me.chanjar.weixin.cp.api.impl; | package me.chanjar.weixin.cp.api.impl; | ||||
| import com.google.common.collect.Lists; | |||||
| import com.google.gson.Gson; | import com.google.gson.Gson; | ||||
| import com.google.inject.Inject; | import com.google.inject.Inject; | ||||
| import me.chanjar.weixin.common.error.WxErrorException; | import me.chanjar.weixin.common.error.WxErrorException; | ||||
| @@ -16,52 +17,33 @@ import java.util.ArrayList; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.List; | import java.util.List; | ||||
| import static org.assertj.core.api.Assertions.assertThat; | |||||
| /** | /** | ||||
| * @author Element | * @author Element | ||||
| * @Package me.chanjar.weixin.cp.api.impl | |||||
| * @date 2019-04-20 13:46 | * @date 2019-04-20 13:46 | ||||
| * @Description: TODO | |||||
| */ | */ | ||||
| @Guice(modules = ApiTestModule.class) | @Guice(modules = ApiTestModule.class) | ||||
| public class WxCpOAServiceImplTest { | public class WxCpOAServiceImplTest { | ||||
| @Inject | @Inject | ||||
| protected WxCpService wxService; | protected WxCpService wxService; | ||||
| @Inject | |||||
| protected Gson gson; | |||||
| @Test | @Test | ||||
| public void testGetCheckinData() throws ParseException, WxErrorException { | public void testGetCheckinData() throws ParseException, WxErrorException { | ||||
| Date starttime,endtime; | |||||
| List<String> 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<WxCpCheckinData> results = wxService.getOAService().getCheckinData(1, starttime,endtime,userLists); | |||||
| System.out.println("results "); | |||||
| System.out.println(gson.toJson(results)); | |||||
| List<WxCpCheckinData> results = wxService.getOAService() | |||||
| .getCheckinData(1, startTime, endTime, Lists.newArrayList("binary")); | |||||
| assertThat(results).isNotNull(); | |||||
| } | } | ||||
| @Test | @Test | ||||
| public void testGetCheckinOption() throws WxErrorException{ | |||||
| public void testGetCheckinOption() throws WxErrorException { | |||||
| Date now = new Date(); | Date now = new Date(); | ||||
| List<String> userLists = new ArrayList<>(); | |||||
| userLists.add("user@aliyun.com"); | |||||
| List<WxCpCheckinOption> results = wxService.getOAService().getCheckinOption(now,userLists); | |||||
| System.out.println("results "); | |||||
| System.out.println(gson.toJson(results)); | |||||
| List<WxCpCheckinOption> results = wxService.getOAService() | |||||
| .getCheckinOption(now, Lists.newArrayList("binary")); | |||||
| assertThat(results).isNotNull(); | |||||
| } | } | ||||
| } | } | ||||