master
kira 6 years ago
parent 8d3c0d5987
commit 0200731725

@ -1,10 +1,13 @@
package au.com.royalpay.payment.manage.kira; package au.com.royalpay.payment.manage.kira;
import au.com.royalpay.payment.core.PaymentApi; 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.MpWechatApi;
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider;
import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage;
import com.alibaba.fastjson.JSONObject;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
@ -14,7 +17,7 @@ import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource; import javax.annotation.Resource;
@SpringBootTest @SpringBootTest
@ActiveProfiles({"dev","alipay","wechat","jd","bestpay"}) @ActiveProfiles({"local","alipay","wechat","jd","bestpay"})
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
public class WechatMessageTest { public class WechatMessageTest {
@ -22,6 +25,8 @@ public class WechatMessageTest {
private PaymentApi paymentApi; private PaymentApi paymentApi;
@Resource @Resource
private MpWechatApiProvider mpWechatApiProvider; private MpWechatApiProvider mpWechatApiProvider;
@Resource
private CustomerServiceService customerServiceService;
@Test @Test
public void asd(){ public void asd(){
@ -39,4 +44,34 @@ public class WechatMessageTest {
api.sendTemplateMessage(msg); 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();
}
} }

Loading…
Cancel
Save