From 0200731725d5ae9a1639b1e286db953b81b6de6e Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Mon, 23 Jul 2018 17:45:17 +0800 Subject: [PATCH] add test --- .../manage/kira/WechatMessageTest.java | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/test/java/au/com/royalpay/payment/manage/kira/WechatMessageTest.java b/src/test/java/au/com/royalpay/payment/manage/kira/WechatMessageTest.java index 7a3bc4404..32e0150e9 100644 --- a/src/test/java/au/com/royalpay/payment/manage/kira/WechatMessageTest.java +++ b/src/test/java/au/com/royalpay/payment/manage/kira/WechatMessageTest.java @@ -1,10 +1,13 @@ package au.com.royalpay.payment.manage.kira; import au.com.royalpay.payment.core.PaymentApi; +import au.com.royalpay.payment.manage.openim.core.CustomerServiceService; import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; +import com.alibaba.fastjson.JSONObject; + import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; @@ -14,7 +17,7 @@ import org.springframework.test.context.junit4.SpringRunner; import javax.annotation.Resource; @SpringBootTest -@ActiveProfiles({"dev","alipay","wechat","jd","bestpay"}) +@ActiveProfiles({"local","alipay","wechat","jd","bestpay"}) @RunWith(SpringRunner.class) public class WechatMessageTest { @@ -22,6 +25,8 @@ public class WechatMessageTest { private PaymentApi paymentApi; @Resource private MpWechatApiProvider mpWechatApiProvider; + @Resource + private CustomerServiceService customerServiceService; @Test public void asd(){ @@ -39,4 +44,34 @@ public class WechatMessageTest { api.sendTemplateMessage(msg); } + + @Test + public void qwe(){ + JSONObject param = new JSONObject(); + param.put("uid","asd"); + param.put("tuid","kira"); + for (int i = 0; i < 10; i++) { + customerServiceService.addUnreadMsg(param); + } + param.put("uid","q1"); + for (int i = 0; i < 45; i++) { + customerServiceService.addUnreadMsg(param); + } + + + JSONObject params = new JSONObject(); + params.put("uid","asd"); + params.put("tuid","asd"); + for (int i = 0; i < 10; i++) { + customerServiceService.addUnreadMsg(params); + } + params.put("uid","q1"); + for (int i = 0; i < 45; i++) { + customerServiceService.addUnreadMsg(params); + } + + customerServiceService.sendUnreadWxMsg(); + + + } }