1
0
mirror of synced 2025-12-22 00:48:00 +08:00

issue #3 获取用户基本信息

This commit is contained in:
Daniel Qian
2014-08-26 12:37:38 +08:00
parent e03bb0dfb8
commit 4c8c42475e
6 changed files with 181 additions and 3 deletions

View File

@@ -1,10 +1,13 @@
package chanjarster.weixin.api;
import org.testng.Assert;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;
import chanjarster.weixin.api.ApiTestModule.WxXmlConfigStorage;
import chanjarster.weixin.bean.result.WxUser;
import chanjarster.weixin.exception.WxErrorException;
import chanjarster.weixin.util.json.WxGsonBuilder;
import com.google.inject.Inject;
@@ -20,10 +23,16 @@ public class WxUserAPITest {
@Inject
protected WxServiceImpl wxService;
@Test
public void testUserUpdateRemark() throws WxErrorException {
WxXmlConfigStorage configProvider = (WxXmlConfigStorage) wxService.wxConfigStorage;
wxService.userUpdateRemark(configProvider.getOpenId(), "测试备注名");
}
public void testUserInfo() throws WxErrorException {
WxXmlConfigStorage configProvider = (WxXmlConfigStorage) wxService.wxConfigStorage;
WxUser user = wxService.userInfo(configProvider.getOpenId(), null);
Assert.assertNotNull(user);
System.out.println(WxGsonBuilder.INSTANCE.create().toJson(user));
}
}