mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-25 01:14:36 +08:00
fix test code
This commit is contained in:
parent
dc33436d51
commit
9246243fae
@ -1,15 +1,6 @@
|
|||||||
package me.chanjar.weixin.mp.api;
|
package me.chanjar.weixin.mp.api;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
|
|
||||||
import org.testng.Assert;
|
|
||||||
import org.testng.annotations.DataProvider;
|
|
||||||
import org.testng.annotations.Guice;
|
|
||||||
import org.testng.annotations.Test;
|
|
||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
|
||||||
import me.chanjar.weixin.common.api.WxConsts;
|
import me.chanjar.weixin.common.api.WxConsts;
|
||||||
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
|
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
|
||||||
import me.chanjar.weixin.common.exception.WxErrorException;
|
import me.chanjar.weixin.common.exception.WxErrorException;
|
||||||
@ -19,11 +10,18 @@ import me.chanjar.weixin.mp.bean.WxMpMassTagMessage;
|
|||||||
import me.chanjar.weixin.mp.bean.WxMpMassVideo;
|
import me.chanjar.weixin.mp.bean.WxMpMassVideo;
|
||||||
import me.chanjar.weixin.mp.bean.result.WxMpMassSendResult;
|
import me.chanjar.weixin.mp.bean.result.WxMpMassSendResult;
|
||||||
import me.chanjar.weixin.mp.bean.result.WxMpMassUploadResult;
|
import me.chanjar.weixin.mp.bean.result.WxMpMassUploadResult;
|
||||||
|
import org.testng.Assert;
|
||||||
|
import org.testng.annotations.DataProvider;
|
||||||
|
import org.testng.annotations.Guice;
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测试群发消息
|
* 测试群发消息
|
||||||
* @author chanjarster
|
|
||||||
*
|
*
|
||||||
|
* @author chanjarster
|
||||||
*/
|
*/
|
||||||
@Test(groups = "massAPI", dependsOnGroups = {"baseAPI", "mediaAPI", "groupAPI"})
|
@Test(groups = "massAPI", dependsOnGroups = {"baseAPI", "mediaAPI", "groupAPI"})
|
||||||
@Guice(modules = ApiTestModule.class)
|
@Guice(modules = ApiTestModule.class)
|
||||||
@ -68,7 +66,7 @@ public class WxMpMassMessageAPITest {
|
|||||||
@Test
|
@Test
|
||||||
public void testTextMassGroupMessageSend() throws WxErrorException {
|
public void testTextMassGroupMessageSend() throws WxErrorException {
|
||||||
WxMpMassTagMessage massMessage = new WxMpMassTagMessage();
|
WxMpMassTagMessage massMessage = new WxMpMassTagMessage();
|
||||||
massMessage.setMsgtype(WxConsts.MASS_MSG_TEXT);
|
massMessage.setMsgType(WxConsts.MASS_MSG_TEXT);
|
||||||
massMessage.setContent("测试群发消息\n欢迎欢迎,热烈欢迎\n换行测试\n超链接:<a href=\"http://www.baidu.com\">Hello World</a>");
|
massMessage.setContent("测试群发消息\n欢迎欢迎,热烈欢迎\n换行测试\n超链接:<a href=\"http://www.baidu.com\">Hello World</a>");
|
||||||
massMessage
|
massMessage
|
||||||
.setTagId(this.wxService.getUserTagService().tagGet().get(0).getId());
|
.setTagId(this.wxService.getUserTagService().tagGet().get(0).getId());
|
||||||
@ -83,7 +81,7 @@ public class WxMpMassMessageAPITest {
|
|||||||
public void testMediaMassGroupMessageSend(String massMsgType, String mediaId)
|
public void testMediaMassGroupMessageSend(String massMsgType, String mediaId)
|
||||||
throws WxErrorException {
|
throws WxErrorException {
|
||||||
WxMpMassTagMessage massMessage = new WxMpMassTagMessage();
|
WxMpMassTagMessage massMessage = new WxMpMassTagMessage();
|
||||||
massMessage.setMsgtype(massMsgType);
|
massMessage.setMsgType(massMsgType);
|
||||||
massMessage.setMediaId(mediaId);
|
massMessage.setMediaId(mediaId);
|
||||||
massMessage
|
massMessage
|
||||||
.setTagId(this.wxService.getUserTagService().tagGet().get(0).getId());
|
.setTagId(this.wxService.getUserTagService().tagGet().get(0).getId());
|
||||||
|
Loading…
Reference in New Issue
Block a user