use of me.chanjar.weixin.mp.bean.WxMpMassGroupMessage in project weixin-java-tools by chanjarster.
the class WxMpMassMessageAPITest method testTextMassGroupMessageSend.
@Test
public void testTextMassGroupMessageSend() throws WxErrorException {
WxMpMassGroupMessage massMessage = new WxMpMassGroupMessage();
massMessage.setMsgtype(WxConsts.MASS_MSG_TEXT);
massMessage.setContent("测试群发消息\n欢迎欢迎,热烈欢迎\n换行测试\n超链接:<a href=\"http://www.baidu.com\">Hello World</a>");
massMessage.setGroupId(wxService.groupGet().get(0).getId());
WxMpMassSendResult massResult = wxService.massGroupMessageSend(massMessage);
Assert.assertNotNull(massResult);
Assert.assertNotNull(massResult.getMsgId());
}
use of me.chanjar.weixin.mp.bean.WxMpMassGroupMessage in project weixin-java-tools by chanjarster.
the class WxMpMassMessageAPITest method testMediaMassGroupMessageSend.
@Test(dataProvider = "massMessages")
public void testMediaMassGroupMessageSend(String massMsgType, String mediaId) throws WxErrorException, IOException {
WxMpMassGroupMessage massMessage = new WxMpMassGroupMessage();
massMessage.setMsgtype(massMsgType);
massMessage.setMediaId(mediaId);
massMessage.setGroupId(wxService.groupGet().get(0).getId());
WxMpMassSendResult massResult = wxService.massGroupMessageSend(massMessage);
Assert.assertNotNull(massResult);
Assert.assertNotNull(massResult.getMsgId());
}
Aggregations