issue #3 获取用户基本信息
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user