Search in sources :

Example 6 with WxCpUser

use of me.chanjar.weixin.cp.bean.WxCpUser in project weixin-java-tools by chanjarster.

the class WxCpUserAPITest method testUserCreate.

public void testUserCreate() throws WxErrorException {
    WxCpUser user = new WxCpUser();
    user.setUserId("some.woman");
    user.setName("Some Woman");
    user.setDepartIds(new Integer[] { 9, 8 });
    user.setEmail("none@none.com");
    user.setGender("女");
    user.setMobile("13560084979");
    user.setPosition("woman");
    user.setTel("3300393");
    user.addExtAttr("爱好", "table");
    wxCpService.userCreate(user);
}
Also used : WxCpUser(me.chanjar.weixin.cp.bean.WxCpUser)

Example 7 with WxCpUser

use of me.chanjar.weixin.cp.bean.WxCpUser in project weixin-java-tools by chanjarster.

the class WxCpUserAPITest method testUserGet.

@Test(dependsOnMethods = "testUserUpdate")
public void testUserGet() throws WxErrorException {
    WxCpUser user = wxCpService.userGet("some.woman");
    Assert.assertNotNull(user);
}
Also used : WxCpUser(me.chanjar.weixin.cp.bean.WxCpUser) Test(org.testng.annotations.Test)

Aggregations

WxCpUser (me.chanjar.weixin.cp.bean.WxCpUser)7 JsonElement (com.google.gson.JsonElement)3 TypeToken (com.google.gson.reflect.TypeToken)3 JsonReader (com.google.gson.stream.JsonReader)3 StringReader (java.io.StringReader)3 Test (org.testng.annotations.Test)2