diff --git a/xdclass-product-service/src/test/java/net/jieyuu/biz/DemoApplicationTests.java b/xdclass-product-service/src/test/java/net/jieyuu/biz/DemoApplicationTests.java new file mode 100644 index 0000000..78bcf4b --- /dev/null +++ b/xdclass-product-service/src/test/java/net/jieyuu/biz/DemoApplicationTests.java @@ -0,0 +1,26 @@ +package net.jieyuu.biz; + +import lombok.extern.slf4j.Slf4j; +import net.jieyuu.ProductApplication; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = ProductApplication.class) +@Slf4j +public class DemoApplicationTests { + + @Autowired + private RabbitTemplate rabbitTemplate; + + @Test + public void send(){ + rabbitTemplate.convertAndSend("stock.event.exchange","stock.release.delay.routing.key","23342342"); + + } + +}