From 3216ed3fb2d9dc9cf61da21bda3175e66ec46426 Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期五, 06 十二月 2024 17:04:11 +0800 Subject: [PATCH] IailabClient 配置 --- shasteel-biz/src/test/java/com/iailab/module/data/controller/RabbitMQTest.java | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a/shasteel-biz/src/test/java/com/iailab/module/data/controller/RabbitMQTest.java b/shasteel-biz/src/test/java/com/iailab/module/data/controller/RabbitMQTest.java new file mode 100644 index 0000000..29d86fe --- /dev/null +++ b/shasteel-biz/src/test/java/com/iailab/module/data/controller/RabbitMQTest.java @@ -0,0 +1,33 @@ +package com.iailab.module.data.controller; + +import com.alibaba.fastjson.JSONObject; +import com.iailab.framework.common.util.date.DateUtils; +import com.iailab.framework.test.core.ut.BaseMockitoUnitTest; +import com.iailab.module.shasteel.ShasteelServerApplication; +import com.iailab.module.shasteel.mq.consumer.PredictFinishMessage; +import org.junit.jupiter.api.Test; +import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.boot.test.context.SpringBootTest; + +import javax.annotation.Resource; +import java.util.Date; + +/** + * @author lirm + * @Description + * @createTime 2024年11月27日 + */ +@SpringBootTest(classes = ShasteelServerApplication.class) +public class RabbitMQTest extends BaseMockitoUnitTest { + + @Resource + private RabbitTemplate rabbitTemplate; + + @Test + public void testProducer() { + JSONObject content = new JSONObject(); + content.put("moduleType", "NET_LDG"); + content.put("predictTime", "2024-12-04 06:30:00"); + rabbitTemplate.convertAndSend(PredictFinishMessage.EXCHANGE, PredictFinishMessage.PREDICTFINISH_ROUTING_KEY, content); + } +} -- Gitblit v1.9.3