@Test public void update() throws WeixinException { User user = new User("id", "name"); user.setPartyIds(1); user.pushExattr("爱好", "code"); JsonResult result = userApi.updateUser(user); Assert.assertEquals("updated", result.getDesc()); }
@Test public void convert() throws WeixinException { String[] result = userApi.userid2openid("jinyu", 1); System.err.println(userApi.openid2userid(result[0])); }
@Test public void invite() throws WeixinException { userApi.inviteUser("11", null); }
@Test public void delete() throws WeixinException { JsonResult result = userApi.deleteUser("u001"); Assert.assertEquals("deleted", result.getDesc()); }
@Test public void list() throws WeixinException { List<User> userList = userApi.listUser(1, true, UserStatus.BOTH, true); Assert.assertFalse(userList.isEmpty()); System.out.println(userList); }
@Test public void get() throws WeixinException { User user = userApi.getUser("jinyu"); Assert.assertTrue(user != null); System.out.println(user); }