@Test(dependsOnMethods = {"testUpdate", "testCreate"}) public void testListAll() throws Exception { List<WxCpTag> tags = this.wxService.getTagService().listAll(); assertNotEquals(tags.size(), 0); }
@Override public List<WxCpTag> listAll() throws WxErrorException { String url = "https: String responseContent = this.mainService.get(url, null); JsonElement tmpJsonElement = new JsonParser().parse(responseContent); return WxCpGsonBuilder.INSTANCE.create() .fromJson( tmpJsonElement.getAsJsonObject().get("taglist"), new TypeToken<List<WxCpTag>>() { }.getType() ); }
WxCpTagServiceImpl implements WxCpTagService { @Override public List<WxCpTag> listAll() throws WxErrorException { String url = "https: String responseContent = this.mainService.get(url, null); JsonElement tmpJsonElement = new JsonParser().parse(responseContent); return WxCpGsonBuilder.INSTANCE.create() .fromJson( tmpJsonElement.getAsJsonObject().get("taglist"), new TypeToken<List<WxCpTag>>() { }.getType() ); } }
WxCpTagServiceImpl implements WxCpTagService { @Override public List<WxCpTag> listAll() throws WxErrorException { String url = "https: String responseContent = this.mainService.get(url, null); JsonElement tmpJsonElement = new JsonParser().parse(responseContent); return WxCpGsonBuilder.INSTANCE.create() .fromJson( tmpJsonElement.getAsJsonObject().get("taglist"), new TypeToken<List<WxCpTag>>() { }.getType() ); } WxCpTagServiceImpl(WxCpService mainService); }
WxCpTagServiceImpl implements WxCpTagService { @Override public List<WxCpTag> listAll() throws WxErrorException { String url = "https: String responseContent = this.mainService.get(url, null); JsonElement tmpJsonElement = new JsonParser().parse(responseContent); return WxCpGsonBuilder.INSTANCE.create() .fromJson( tmpJsonElement.getAsJsonObject().get("taglist"), new TypeToken<List<WxCpTag>>() { }.getType() ); } WxCpTagServiceImpl(WxCpService mainService); @Override String create(String tagName); @Override void update(String tagId, String tagName); @Override void delete(String tagId); @Override List<WxCpTag> listAll(); @Override List<WxCpUser> listUsersByTagId(String tagId); @Override WxCpTagAddOrRemoveUsersResult addUsers2Tag(String tagId, List<String> userIds, List<String> partyIds); @Override WxCpTagAddOrRemoveUsersResult removeUsersFromTag(String tagId, List<String> userIds, List<String> partyIds); @Override WxCpTagGetResult get(String tagId); }
WxCpTagServiceImpl implements WxCpTagService { @Override public List<WxCpTag> listAll() throws WxErrorException { String url = "https: String responseContent = this.mainService.get(url, null); JsonElement tmpJsonElement = new JsonParser().parse(responseContent); return WxCpGsonBuilder.INSTANCE.create() .fromJson( tmpJsonElement.getAsJsonObject().get("taglist"), new TypeToken<List<WxCpTag>>() { }.getType() ); } WxCpTagServiceImpl(WxCpService mainService); @Override String create(String tagName); @Override void update(String tagId, String tagName); @Override void delete(String tagId); @Override List<WxCpTag> listAll(); @Override List<WxCpUser> listUsersByTagId(String tagId); @Override WxCpTagAddOrRemoveUsersResult addUsers2Tag(String tagId, List<String> userIds, List<String> partyIds); @Override WxCpTagAddOrRemoveUsersResult removeUsersFromTag(String tagId, List<String> userIds, List<String> partyIds); @Override WxCpTagGetResult get(String tagId);  }