1
0
mirror of synced 2025-12-27 13:37:59 +08:00

🆕 #1675 企业微信增加更新、查询和删除日历的接口

This commit is contained in:
Binary Wang
2020-10-05 23:48:07 +08:00
parent 18f3f4001c
commit 64402ab1de
8 changed files with 185 additions and 11 deletions

View File

@@ -9,6 +9,9 @@ import org.testng.annotations.Guice;
import org.testng.annotations.Test;
import java.util.Arrays;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
/**
* 单元测试.
@@ -22,18 +25,46 @@ import java.util.Arrays;
public class WxCpOaCalendarServiceImplTest {
@Inject
protected WxCpService wxService;
private final String calId = "wcbBJNCQAARipW967iE8DKPAp5Kb96qQ";
@Test
public void testAdd() throws WxErrorException {
this.wxService.getOaCalendarService().add(WxCpOaCalendar.builder()
.organizer("userid1")
.organizer("binary")
.readonly(1)
.setAsDefault(1)
.summary("test_summary")
.color("#FF3030")
.description("test_describe")
.shares(Arrays.asList(new WxCpOaCalendar.ShareInfo("userid2", null),
new WxCpOaCalendar.ShareInfo("userid3", 1)))
.shares(Arrays.asList(new WxCpOaCalendar.ShareInfo("binary", null),
new WxCpOaCalendar.ShareInfo("binary", 1)))
.build());
}
@Test
public void testUpdate() throws WxErrorException {
this.wxService.getOaCalendarService().update(WxCpOaCalendar.builder()
.calId(calId)
.organizer("binary")
.readonly(1)
.setAsDefault(1)
.summary("test_summary")
.color("#FF3030")
.description("test_describe")
.shares(Arrays.asList(new WxCpOaCalendar.ShareInfo("binary", null),
new WxCpOaCalendar.ShareInfo("binary", 1)))
.build());
}
@Test
public void testGet() throws WxErrorException {
final List<WxCpOaCalendar> calendars = this.wxService.getOaCalendarService()
.get(Arrays.asList(calId));
assertThat(calendars).isNotEmpty();
}
@Test
public void testDelete() throws WxErrorException {
this.wxService.getOaCalendarService().delete(calId);
}
}