This commit is contained in:
Daniel Qian
2014-10-22 14:45:38 +08:00
parent 2c96d542d6
commit de67b77c22
8 changed files with 25 additions and 25 deletions

View File

@ -21,7 +21,7 @@ import com.google.inject.Inject;
public class WxCpDepartAPITest {
@Inject
protected WxCpServiceImpl wxService;
protected WxCpServiceImpl wxCpService;
protected WxCpDepart depart;
@ -30,13 +30,13 @@ public class WxCpDepartAPITest {
depart.setName("子部门" + System.currentTimeMillis());
depart.setParentId(1);
depart.setOrder(1);
Integer departId = wxService.departCreate(depart);
Integer departId = wxCpService.departCreate(depart);
}
@Test(dependsOnMethods = "testDepartCreate")
public void testDepartGet() throws WxErrorException {
System.out.println("=================获取部门");
List<WxCpDepart> departList = wxService.departGet();
List<WxCpDepart> departList = wxCpService.departGet();
Assert.assertNotNull(departList);
Assert.assertTrue(departList.size() > 0);
for (WxCpDepart g : departList) {
@ -50,14 +50,14 @@ public class WxCpDepartAPITest {
public void testDepartUpdate() throws WxErrorException {
System.out.println("=================更新部门");
depart.setName("子部门改名" + System.currentTimeMillis());
wxService.departUpdate(depart);
wxCpService.departUpdate(depart);
}
@Test(dependsOnMethods = "testDepartUpdate")
public void testDepartDelete() throws WxErrorException {
System.out.println("=================删除部门");
System.out.println(depart.getId() + ":" + depart.getName());
wxService.departDelete(depart.getId());
wxCpService.departDelete(depart.getId());
}
}

View File

@ -20,7 +20,7 @@ import java.util.List;
public class WxCpUserAPITest {
@Inject
protected WxCpServiceImpl wxService;
protected WxCpServiceImpl wxCpService;
protected WxCpDepart depart;
@ -35,7 +35,7 @@ public class WxCpUserAPITest {
user.setPosition("老婆");
user.setTel("3300393");
user.addExtAttr("爱好", "老公");
wxService.userCreate(user);
wxCpService.userCreate(user);
}
@Test(dependsOnMethods = "testUserCreate")
@ -44,23 +44,23 @@ public class WxCpUserAPITest {
user.setUserId("xiaohe.yang");
user.setName("杨宝");
user.addExtAttr("爱好", "老公2");
wxService.userUpdate(user);
wxCpService.userUpdate(user);
}
@Test(dependsOnMethods = "testUserUpdate")
public void testUserGet() throws WxErrorException {
WxCpUser user = wxService.userGet("xiaohe.yang");
WxCpUser user = wxCpService.userGet("xiaohe.yang");
Assert.assertNotNull(user);
}
@Test(dependsOnMethods = "testUserGet")
public void testDepartGetUsers() throws WxErrorException {
List<WxCpUser> users = wxService.departGetUsers(1, true, 0);
List<WxCpUser> users = wxCpService.departGetUsers(1, true, 0);
Assert.assertNotEquals(users.size(), 0);
}
@Test(dependsOnMethods = "testDepartGetUsers")
public void testUserDelete() throws WxErrorException {
wxService.userDelete("xiaohe.yang");
wxCpService.userDelete("xiaohe.yang");
}
}