mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-25 01:14:36 +08:00
🎨 修复测试类
This commit is contained in:
parent
8449f2f942
commit
d6d0e35984
@ -1,8 +1,13 @@
|
|||||||
package me.chanjar.weixin.cp.bean.external;
|
package me.chanjar.weixin.cp.bean.external;
|
||||||
|
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import lombok.val;
|
||||||
|
import me.chanjar.weixin.common.util.json.GsonParser;
|
||||||
|
import me.chanjar.weixin.cp.bean.WxCpDepart;
|
||||||
import me.chanjar.weixin.cp.bean.external.contact.ExternalContact;
|
import me.chanjar.weixin.cp.bean.external.contact.ExternalContact;
|
||||||
import me.chanjar.weixin.cp.bean.external.contact.FollowedUser;
|
import me.chanjar.weixin.cp.bean.external.contact.FollowedUser;
|
||||||
import me.chanjar.weixin.cp.bean.external.contact.WxCpExternalContactInfo;
|
import me.chanjar.weixin.cp.bean.external.contact.WxCpExternalContactInfo;
|
||||||
|
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
|
||||||
import org.testng.annotations.*;
|
import org.testng.annotations.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -78,8 +83,8 @@ public class WxCpUserExternalContactInfoTest {
|
|||||||
" }\n" +
|
" }\n" +
|
||||||
" ]\n" +
|
" ]\n" +
|
||||||
"}";
|
"}";
|
||||||
|
|
||||||
final String testJson = "{\n" +
|
final String testJson = "{\n" +
|
||||||
" \"errcode\": 0,\n" +
|
" \"errcode\": 0,\n" +
|
||||||
" \"errmsg\": \"ok\",\n" +
|
" \"errmsg\": \"ok\",\n" +
|
||||||
" \"department\": [\n" +
|
" \"department\": [\n" +
|
||||||
@ -114,7 +119,7 @@ public class WxCpUserExternalContactInfoTest {
|
|||||||
String toJson = depart.toJson();
|
String toJson = depart.toJson();
|
||||||
|
|
||||||
// 测试企业微信字段返回
|
// 测试企业微信字段返回
|
||||||
List<WxCpDepart> department = WxCpGsonBuilder.create().fromJson(GsonParser.parse(two).get("department"), new TypeToken<List<WxCpDepart>>() {
|
List<WxCpDepart> department = WxCpGsonBuilder.create().fromJson(GsonParser.parse(testJson).get("department"), new TypeToken<List<WxCpDepart>>() {
|
||||||
}.getType());
|
}.getType());
|
||||||
|
|
||||||
final WxCpExternalContactInfo contactInfo = WxCpExternalContactInfo.fromJson(json);
|
final WxCpExternalContactInfo contactInfo = WxCpExternalContactInfo.fromJson(json);
|
||||||
|
Loading…
Reference in New Issue
Block a user