|
|
@@ -1,6 +1,8 @@
|
|
|
package com.usoftchina.saas.transfers.service;
|
|
|
|
|
|
+import com.rabbitmq.tools.json.JSONUtil;
|
|
|
import com.usoftchina.saas.transfers.dto.MessageInfo;
|
|
|
+import com.usoftchina.saas.utils.JsonUtils;
|
|
|
import org.junit.Test;
|
|
|
import org.junit.runner.RunWith;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -31,10 +33,9 @@ public class RabbitSendServiceTest {
|
|
|
|
|
|
@Test
|
|
|
public void TestB_SendDelay() {
|
|
|
- MessageInfo msg = new MessageInfo();
|
|
|
- msg.setBizId("测试");
|
|
|
- msg.setMsgId("测试延迟0001");
|
|
|
- sendService.sendDelayMessage(msg, "测试");
|
|
|
+ MessageInfo messageInfo = JsonUtils.fromJsonString("{\"msgId\":\"72b04cac-c318-428d-8444-87ca2a2f7ec3\",\"userId\":65,\"appId\":\"trade\",\"bizType\":\"PURCHASE\",\"bizId\":\"1944\",\"companyId\":371,\"timestamp\":1548147987040}", MessageInfo.class);
|
|
|
+ sendService.sendDelayMessage(messageInfo, "测试重新发送");
|
|
|
+ System.out.println("发送延迟队列成功");
|
|
|
}
|
|
|
|
|
|
|