1
0
mirror of synced 2025-12-27 21:48:01 +08:00

🆕 #2722【企业微信】 增加会议室管理相关接口

This commit is contained in:
懒猫
2022-08-16 19:48:18 +08:00
committed by GitHub
parent 6472484b32
commit 94ff00bc4b
7 changed files with 314 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
package me.chanjar.weixin.cp.api.impl;
import com.google.inject.Inject;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.api.ApiTestModule;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.bean.oa.meetingroom.WxCpOaMeetingRoom;
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;
/**
* 单元测试.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2020-09-20
*/
@Test
@Guice(modules = ApiTestModule.class)
public class WxCpOaMeetingRoomServiceImplTest {
@Inject
protected WxCpService wxService;
@Test
public void testAdd() throws WxErrorException {
this.wxService.getOaMeetingRoomService().addMeetingRoom(WxCpOaMeetingRoom.builder()
.building("腾讯大厦")
.capacity(10)
.city("深圳")
.name("18F-会议室")
.floor("18F")
.equipment(Arrays.asList(1, 2))
// .coordinate()
.build());
}
@Test
public void testUpdate() throws WxErrorException {
this.wxService.getOaMeetingRoomService().editMeetingRoom(WxCpOaMeetingRoom.builder()
.building("腾讯大厦")
.capacity(10)
.city("深圳")
.name("16F-会议室")
.floor("16F")
.equipment(Arrays.asList(1, 2, 3))
.meetingroomId(1)
.build());
}
@Test
public void testGet() throws WxErrorException {
final List<WxCpOaMeetingRoom> meetingRooms = this.wxService.getOaMeetingRoomService().listMeetingRoom(WxCpOaMeetingRoom.builder()
.building("腾讯大厦")
.city("深圳")
.equipment(Arrays.asList(1, 2))
.build());
assertThat(meetingRooms).isNotEmpty();
}
@Test
public void testDelete() throws WxErrorException {
Integer calId = 1;
this.wxService.getOaMeetingRoomService().deleteMeetingRoom(calId);
}
}