9
9
import me .chanjar .weixin .mp .bean .template .WxMpTemplateData ;
10
10
import me .chanjar .weixin .mp .bean .template .WxMpTemplateIndustry ;
11
11
import me .chanjar .weixin .mp .bean .template .WxMpTemplateMessage ;
12
+ import org .apache .commons .lang3 .RandomStringUtils ;
12
13
import org .testng .Assert ;
13
14
import org .testng .annotations .Guice ;
14
15
import org .testng .annotations .Test ;
@@ -28,7 +29,7 @@ public class WxMpTemplateMsgServiceImplTest {
28
29
@ Inject
29
30
protected WxMpService wxService ;
30
31
31
- @ Test (invocationCount = 10 , threadPoolSize = 10 )
32
+ @ Test (invocationCount = 5 , threadPoolSize = 3 )
32
33
public void testSendTemplateMsg () throws WxErrorException {
33
34
SimpleDateFormat dateFormat = new SimpleDateFormat (
34
35
"yyyy-MM-dd HH:mm:ss.SSS" );
@@ -39,6 +40,8 @@ public void testSendTemplateMsg() throws WxErrorException {
39
40
.templateId (configStorage .getTemplateId ()).build ();
40
41
templateMessage .addWxMpTemplateData (
41
42
new WxMpTemplateData ("first" , dateFormat .format (new Date ())));
43
+ templateMessage .addWxMpTemplateData (
44
+ new WxMpTemplateData ("remark" , RandomStringUtils .randomAlphanumeric (100 ), "#FF00FF" ));
42
45
String msgId = this .wxService .getTemplateMsgService ().sendTemplateMsg (templateMessage );
43
46
Assert .assertNotNull (msgId );
44
47
System .out .println (msgId );
0 commit comments