1
0
mirror of synced 2026-02-19 12:17:55 +08:00

#456 企业微信获取部门列表接口方法listAll修改为list,以支持按部分id获取其下属部门列表

This commit is contained in:
Binary Wang
2018-03-18 14:25:22 +08:00
parent e3293d1521
commit 0c7a472a16
4 changed files with 30 additions and 14 deletions

View File

@@ -8,6 +8,7 @@ import org.testng.annotations.*;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
import static org.testng.Assert.*;
/**
@@ -34,16 +35,24 @@ public class WxCpDepartmentServiceImplTest {
System.out.println(departId);
}
@Test
public void testListAll() throws Exception {
@DataProvider
public Object[][] departIds(){
return new Object[][]{
{null},
{1},
{5}
};
}
@Test(dataProvider = "departIds")
public void testList(Integer id) throws Exception {
System.out.println("=================获取部门");
List<WxCpDepart> departList = this.wxCpService.getDepartmentService().listAll();
assertNotNull(departList);
assertTrue(departList.size() > 0);
List<WxCpDepart> departList = this.wxCpService.getDepartmentService().list(id);
assertThat(departList).isNotEmpty();
for (WxCpDepart g : departList) {
this.depart = g;
System.out.println(this.depart.getId() + ":" + this.depart.getName());
assertNotNull(g.getName());
assertThat(g.getName()).isNotBlank();
}
}