@@ -41,7 +41,7 @@ public void testTextMassOpenIdsMessageSend() throws WxErrorException {
4141 WxMpMassOpenIdsMessage massMessage = new WxMpMassOpenIdsMessage ();
4242 massMessage .setMsgType (WxConsts .MASS_MSG_TEXT );
4343 massMessage .setContent ("测试群发消息\n 欢迎欢迎,热烈欢迎\n 换行测试\n 超链接:<a href=\" http://www.baidu.com\" >Hello World</a>" );
44- massMessage .getToUsers ().add (configProvider .getOpenId ());
44+ massMessage .getToUsers ().add (configProvider .getOpenid ());
4545
4646 WxMpMassSendResult massResult = this .wxService
4747 .massOpenIdsMessageSend (massMessage );
@@ -58,7 +58,7 @@ public void testMediaMassOpenIdsMessageSend(String massMsgType,
5858 WxMpMassOpenIdsMessage massMessage = new WxMpMassOpenIdsMessage ();
5959 massMessage .setMsgType (massMsgType );
6060 massMessage .setMediaId (mediaId );
61- massMessage .getToUsers ().add (configProvider .getOpenId ());
61+ massMessage .getToUsers ().add (configProvider .getOpenid ());
6262
6363 WxMpMassSendResult massResult = this .wxService
6464 .massOpenIdsMessageSend (massMessage );
@@ -73,13 +73,13 @@ public void testTextMassGroupMessageSend() throws WxErrorException {
7373 massMessage .setContent ("测试群发消息\n 欢迎欢迎,热烈欢迎\n 换行测试\n 超链接:<a href=\" http://www.baidu.com\" >Hello World</a>" );
7474 massMessage
7575 .setGroupId (this .wxService .getGroupService ().groupGet ().get (0 ).getId ());
76-
76+
7777 WxMpMassSendResult massResult = this .wxService
7878 .massGroupMessageSend (massMessage );
7979 Assert .assertNotNull (massResult );
8080 Assert .assertNotNull (massResult .getMsgId ());
8181 }
82-
82+
8383 @ Test (dataProvider ="massMessages" )
8484 public void testMediaMassGroupMessageSend (String massMsgType , String mediaId )
8585 throws WxErrorException {
@@ -94,7 +94,7 @@ public void testMediaMassGroupMessageSend(String massMsgType, String mediaId)
9494 Assert .assertNotNull (massResult );
9595 Assert .assertNotNull (massResult .getMsgId ());
9696 }
97-
97+
9898 @ DataProvider
9999 public Object [][] massMessages () throws WxErrorException , IOException {
100100 Object [][] messages = new Object [4 ][];
@@ -109,7 +109,7 @@ public Object[][] massMessages() throws WxErrorException, IOException {
109109 .mediaUpload (WxConsts .MEDIA_VIDEO , WxConsts .FILE_MP4 , inputStream );
110110 Assert .assertNotNull (uploadMediaRes );
111111 Assert .assertNotNull (uploadMediaRes .getMediaId ());
112-
112+
113113 // 把视频变成可被群发的媒体
114114 WxMpMassVideo video = new WxMpMassVideo ();
115115 video .setTitle ("测试标题" );
@@ -155,15 +155,15 @@ public Object[][] massMessages() throws WxErrorException, IOException {
155155 .mediaUpload (WxConsts .MEDIA_IMAGE , WxConsts .FILE_JPG , inputStream );
156156 Assert .assertNotNull (uploadMediaRes );
157157 Assert .assertNotNull (uploadMediaRes .getMediaId ());
158-
158+
159159 // 上传图文消息
160160 WxMpMassNews news = new WxMpMassNews ();
161161 WxMpMassNews .WxMpMassNewsArticle article1 = new WxMpMassNews .WxMpMassNewsArticle ();
162162 article1 .setTitle ("标题1" );
163163 article1 .setContent ("内容1内容1内容1内容1内容1内容1内容1内容1内容1内容1内容1内容1内容1内容1内容1内容1内容1内容1内容1内容1内容1" );
164164 article1 .setThumbMediaId (uploadMediaRes .getMediaId ());
165165 news .addArticle (article1 );
166-
166+
167167 WxMpMassNews .WxMpMassNewsArticle article2 = new WxMpMassNews .WxMpMassNewsArticle ();
168168 article2 .setTitle ("标题2" );
169169 article2 .setContent ("内容2内容2内容2内容2内容2内容2内容2内容2内容2内容2内容2内容2内容2内容2内容2内容2内容2内容2内容2内容2内容2" );
@@ -173,7 +173,7 @@ public Object[][] massMessages() throws WxErrorException, IOException {
173173 article2 .setContentSourceUrl ("www.baidu.com" );
174174 article2 .setDigest ("摘要2" );
175175 news .addArticle (article2 );
176-
176+
177177 WxMpMassUploadResult massUploadResult = this .wxService
178178 .massNewsUpload (news );
179179 Assert .assertNotNull (massUploadResult );
@@ -183,5 +183,5 @@ public Object[][] massMessages() throws WxErrorException, IOException {
183183
184184 return messages ;
185185 }
186-
186+
187187}
0 commit comments