1
0
mirror of synced 2025-12-24 02:57:55 +08:00

#409 实现企业微信的userid与openid互换接口

This commit is contained in:
Binary Wang
2018-03-03 17:09:56 +08:00
parent 0b7c1da5a8
commit a6d73a249d
3 changed files with 102 additions and 2 deletions

View File

@@ -6,11 +6,14 @@ import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.bean.WxCpUser;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.testng.annotations.*;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;
import java.util.List;
import java.util.Map;
import static org.testng.Assert.*;
import static org.testng.Assert.assertNotEquals;
import static org.testng.Assert.assertNotNull;
/**
* <pre>
@@ -83,4 +86,24 @@ public class WxCpUserServiceImplTest {
}
}
@Test
@Deprecated
public void testInvite() throws Exception {
int result = this.wxCpService.getUserService().invite(userId, "");
System.out.println(result);
}
@Test
public void testUserId2Openid() throws Exception {
Map<String, String> result = this.wxCpService.getUserService().userId2Openid(userId, null);
System.out.println(result);
assertNotNull(result);
}
@Test
public void testOpenid2UserId() throws Exception {
String result = this.wxCpService.getUserService().openid2UserId(userId);
System.out.println(result);
assertNotNull(result);
}
}