liusheng
2024-04-30 01a79d5b431b71cc79cf5f6cc92cd4f3432781dd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.ruoyi.web.test;
 
import com.smartor.config.RabbitMqConfig;
import org.junit.Test;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.SpringVersion;
 
import java.util.regex.Matcher;
import java.util.regex.Pattern;
 
//@SpringBootTest
//@RunWith(SpringRunner.class)
public class MQTest {
    @Autowired
    private RabbitTemplate rabbitTemplate;
 
    @Test
    public void testSend() {
 
 
        Pattern pattern = Pattern.compile("(?=.*(?:还行|挺好|可以|不错)).*$");
        Matcher matcher = pattern.matcher("还行吧,就是还有点疼");
        System.out.println(matcher.matches());
        System.out.println("Spring Framework版本:" + SpringVersion.getVersion());
//        rabbitTemplate.convertAndSend(RabbitMqConfig.EXCHANGE_NAME, "phone.001", "测试数据001");
//        rabbitTemplate.convertAndSend(RabbitMqConfig.EXCHANGE_NAME, "phone.002", "测试数据002");
//        rabbitTemplate.convertAndSend(RabbitMqConfig.EXCHANGE_NAME, "phone.003", "测试数据003");
    }
}