fix test code

This commit is contained in:
Binary Wang 2016-12-20 16:53:32 +08:00
parent dc33436d51
commit 9246243fae

View File

@ -1,15 +1,6 @@
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 me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
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.result.WxMpMassSendResult;
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"})
@Guice(modules = ApiTestModule.class)
@ -68,7 +66,7 @@ public class WxMpMassMessageAPITest {
@Test
public void testTextMassGroupMessageSend() throws WxErrorException {
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
.setTagId(this.wxService.getUserTagService().tagGet().get(0).getId());
@ -83,7 +81,7 @@ public class WxMpMassMessageAPITest {
public void testMediaMassGroupMessageSend(String massMsgType, String mediaId)
throws WxErrorException {
WxMpMassTagMessage massMessage = new WxMpMassTagMessage();
massMessage.setMsgtype(massMsgType);
massMessage.setMsgType(massMsgType);
massMessage.setMediaId(mediaId);
massMessage
.setTagId(this.wxService.getUserTagService().tagGet().get(0).getId());