@@ -4,6 +4,8 @@ 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;
import me.chanjar.weixin.mp.api.test.ApiTestModule;
import me.chanjar.weixin.mp.api.test.TestConfigStorage;
import me.chanjar.weixin.mp.bean.WxMpMassNews;
import me.chanjar.weixin.mp.bean.WxMpMassOpenIdsMessage;
import me.chanjar.weixin.mp.bean.WxMpMassTagMessage;
@@ -33,7 +35,7 @@ public class WxMpMassMessageAPITest {
@Test
public void testTextMassOpenIdsMessageSend() throws WxErrorException {
// 发送群发消息
WxXmlMpInMemoryConfigStorage configProvider = (WxXmlMpInMemory ConfigStorage) this.wxService
TestConfigStorage configProvider = (Test ConfigStorage) this.wxService
.getWxMpConfigStorage();
WxMpMassOpenIdsMessage massMessage = new WxMpMassOpenIdsMessage();
massMessage.setMsgType(WxConsts.MASS_MSG_TEXT);
@@ -47,10 +49,9 @@ public class WxMpMassMessageAPITest {
}
@Test(dataProvider = "massMessages")
public void testMediaMassOpenIdsMessageSend(String massMsgType,
String mediaId) throws WxErrorException {
public void testMediaMassOpenIdsMessageSend(String massMsgType, String mediaId) throws WxErrorException {
// 发送群发消息
WxXmlMpInMemoryConfigStorage configProvider = (WxXmlMpInMemory ConfigStorage) this.wxService
TestConfigStorage configProvider = (Test ConfigStorage) this.wxService
.getWxMpConfigStorage();
WxMpMassOpenIdsMessage massMessage = new WxMpMassOpenIdsMessage();
massMessage.setMsgType(massMsgType);
@@ -83,8 +84,7 @@ public class WxMpMassMessageAPITest {
WxMpMassTagMessage massMessage = new WxMpMassTagMessage();
massMessage.setMsgType(massMsgType);
massMessage.setMediaId(mediaId);
massMessage
.setTagId(this.wxService.getUserTagService().tagGet().get(0).getId());
massMessage.setTagId(this.wxService.getUserTagService().tagGet().get(0).getId());
WxMpMassSendResult massResult = this.wxService
.massGroupMessageSend(massMessage);
@@ -118,7 +118,7 @@ public class WxMpMassMessageAPITest {
messages[0] = new Object[]{WxConsts.MASS_MSG_VIDEO, uploadResult.getMediaId()};
}
/**
/*
* 图片素材
*/
try (InputStream inputStream = ClassLoader
@@ -130,7 +130,7 @@ public class WxMpMassMessageAPITest {
messages[1] = new Object[]{WxConsts.MASS_MSG_IMAGE, uploadMediaRes.getMediaId()};
}
/**
/*
* 语音素材
*/
try (InputStream inputStream = ClassLoader
@@ -142,7 +142,7 @@ public class WxMpMassMessageAPITest {
messages[2] = new Object[]{WxConsts.MASS_MSG_VOICE, uploadMediaRes.getMediaId()};
}
/**
/*
* 图文素材
*/
try (InputStream inputStream = ClassLoader