添加代码示例springboot-rabbitmq

This commit is contained in:
yidao620
2018-03-01 10:59:05 +08:00
parent 41927e2762
commit dab9c8968f
12 changed files with 547 additions and 2 deletions

View File

@ -0,0 +1,35 @@
package com.xncoding.service;
import com.xncoding.pos.Application;
import com.xncoding.pos.service.SenderService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
/**
* UserServiceTest
*
* @author XiongNeng
* @version 1.0
* @since 2018/2/2
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
public class SenderServiceTest {
@Autowired
private SenderService senderService;
@Test
public void testCache() {
// 测试广播模式
senderService.broadcast("同学们集合啦!");
// 测试Direct模式
senderService.direct("定点消息");
}
}