Skip to content

Commit 1bd4f68

Browse files
committed
完善模板消息发送的单元测试,加入颜色
1 parent 6cf7b08 commit 1bd4f68

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpTemplateMsgServiceImplTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import me.chanjar.weixin.mp.bean.template.WxMpTemplateData;
1010
import me.chanjar.weixin.mp.bean.template.WxMpTemplateIndustry;
1111
import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;
12+
import org.apache.commons.lang3.RandomStringUtils;
1213
import org.testng.Assert;
1314
import org.testng.annotations.Guice;
1415
import org.testng.annotations.Test;
@@ -28,7 +29,7 @@ public class WxMpTemplateMsgServiceImplTest {
2829
@Inject
2930
protected WxMpService wxService;
3031

31-
@Test(invocationCount = 10, threadPoolSize = 10)
32+
@Test(invocationCount = 5, threadPoolSize = 3)
3233
public void testSendTemplateMsg() throws WxErrorException {
3334
SimpleDateFormat dateFormat = new SimpleDateFormat(
3435
"yyyy-MM-dd HH:mm:ss.SSS");
@@ -39,6 +40,8 @@ public void testSendTemplateMsg() throws WxErrorException {
3940
.templateId(configStorage.getTemplateId()).build();
4041
templateMessage.addWxMpTemplateData(
4142
new WxMpTemplateData("first", dateFormat.format(new Date())));
43+
templateMessage.addWxMpTemplateData(
44+
new WxMpTemplateData("remark", RandomStringUtils.randomAlphanumeric(100), "#FF00FF"));
4245
String msgId = this.wxService.getTemplateMsgService().sendTemplateMsg(templateMessage);
4346
Assert.assertNotNull(msgId);
4447
System.out.println(msgId);

0 commit comments

Comments
 (0)