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

用户信息添加新增的tagid_list属性

This commit is contained in:
BinaryWang
2016-09-28 13:19:36 +08:00
parent aabdc8e4b0
commit 742c74d850
9 changed files with 131 additions and 88 deletions

View File

@@ -1,7 +1,3 @@
/**
* Copyright(c) 2011-2016 by UCredit Inc.
* All Rights Reserved
*/
package me.chanjar.weixin.mp.api;
import org.apache.commons.lang3.builder.ToStringBuilder;

View File

@@ -1,7 +1,3 @@
/**
* Copyright(c) 2011-2016 by UCredit Inc.
* All Rights Reserved
*/
package me.chanjar.weixin.mp.api.impl;
import static org.junit.Assert.assertNotNull;

View File

@@ -1,10 +1,11 @@
package me.chanjar.weixin.mp.api.impl;
import java.util.ArrayList;
import java.util.List;
import org.testng.Assert;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;
@@ -28,34 +29,42 @@ import me.chanjar.weixin.mp.bean.result.WxMpUserList;
public class WxMpUserServiceImplTest {
@Inject
protected WxMpServiceImpl wxService;
private WxMpServiceImpl wxService;
private WxXmlMpInMemoryConfigStorage configProvider;
@BeforeTest
public void setup() {
this.configProvider = (WxXmlMpInMemoryConfigStorage) this.wxService
.getWxMpConfigStorage();
}
public void testUserUpdateRemark() throws WxErrorException {
WxXmlMpInMemoryConfigStorage configProvider = (WxXmlMpInMemoryConfigStorage) this.wxService.getWxMpConfigStorage();
this.wxService.getUserService().userUpdateRemark(configProvider.getOpenid(), "测试备注名");
this.wxService.getUserService()
.userUpdateRemark(this.configProvider.getOpenid(), "测试备注名");
}
public void testUserInfo() throws WxErrorException {
WxXmlMpInMemoryConfigStorage configProvider = (WxXmlMpInMemoryConfigStorage) this.wxService.getWxMpConfigStorage();
WxMpUser user = this.wxService.getUserService().userInfo(configProvider.getOpenid(), null);
WxMpUser user = this.wxService.getUserService()
.userInfo(this.configProvider.getOpenid(), null);
Assert.assertNotNull(user);
System.out.println(user);
}
public void testUserInfoList() throws WxErrorException {
WxXmlMpInMemoryConfigStorage configProvider = (WxXmlMpInMemoryConfigStorage) this.wxService.getWxMpConfigStorage();
List<String> openIdList = new ArrayList<>();
openIdList.add(configProvider.getOpenid());
List<WxMpUser> userList = this.wxService.getUserService().userInfoList(openIdList);
List<String> openids = new ArrayList<>();
openids.add(this.configProvider.getOpenid());
List<WxMpUser> userList = this.wxService.getUserService()
.userInfoList(openids);
Assert.assertEquals(userList.size(), 1);
System.out.println(userList);
System.out.println(userList);
}
public void testUserInfoListByWxMpUserQuery() throws WxErrorException {
WxXmlMpInMemoryConfigStorage configProvider = (WxXmlMpInMemoryConfigStorage) this.wxService.getWxMpConfigStorage();
WxMpUserQuery query = new WxMpUserQuery();
query.add(configProvider.getOpenid(), "zh_CN");
List<WxMpUser> userList = this.wxService.getUserService().userInfoList(query);
query.add(this.configProvider.getOpenid(), "zh_CN");
List<WxMpUser> userList = this.wxService.getUserService()
.userInfoList(query);
Assert.assertEquals(userList.size(), 1);
System.out.println(userList);
}
@@ -68,6 +77,5 @@ public class WxMpUserServiceImplTest {
Assert.assertFalse(wxMpUserList.getOpenIds().size() == -1);
System.out.println(wxMpUserList);
}
}