🆕 #1675 企业微信增加更新、查询和删除日历的接口
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user