1
0
mirror of synced 2025-12-22 09:58:07 +08:00

issue #1 添加分组管理接口-移动用户分组

This commit is contained in:
Daniel Qian
2014-08-25 20:06:49 +08:00
parent 521c72ca57
commit 5ea560f6b4
4 changed files with 35 additions and 9 deletions

View File

@@ -24,6 +24,8 @@ public class WxGroupAPITest {
@Inject
protected WxServiceImpl wxService;
protected WxGroup group;
public void testGroupCreate() throws WxErrorException {
WxGroup res = wxService.groupCreate("测试分组1");
Assert.assertEquals(res.getName(), "测试分组1");
@@ -35,7 +37,7 @@ public class WxGroupAPITest {
Assert.assertNotNull(groupList);
Assert.assertTrue(groupList.size() > 0);
for (WxGroup g : groupList) {
System.out.println(g.toString());
group = g;
Assert.assertNotNull(g.getName());
}
}
@@ -44,12 +46,18 @@ public class WxGroupAPITest {
public void testGroupQueryUserGroup() throws WxErrorException {
WxXmlConfigStorage configStorage = (WxXmlConfigStorage) wxService.wxConfigStorage;
long groupid = wxService.groupQueryUserGroup(configStorage.getOpenId());
Assert.assertTrue(groupid != -1l);
}
@Test(dependsOnMethods={"testGroupGet", "testGroupCreate"})
public void getGroupUpdate() throws WxErrorException {
WxGroup group = new WxGroup();
group.setId(3);
group.setName("未命名分组");
group.setName("分组改名");
wxService.groupUpdate(group);
}
@Test(dependsOnMethods={"testGroupGet", "testGroupCreate"})
public void getGroupMoveUser() throws WxErrorException {
WxXmlConfigStorage configStorage = (WxXmlConfigStorage) wxService.wxConfigStorage;
wxService.groupMoveUser(configStorage.getOpenId(), group.getId());
}
}