✨Feat: 实现消息发送与接收
This commit is contained in:
@@ -12,13 +12,21 @@ class MessageProducerTest {
|
||||
@Resource
|
||||
private MessageProducer messageProducer;
|
||||
|
||||
|
||||
/**
|
||||
* 测试方法:用于发送电子邮件消息
|
||||
* 该方法使用messageProducer对象调用sendEmailMessage方法
|
||||
* 传入一个Message对象,其中包含电子邮件地址"hello@example.com"
|
||||
*/
|
||||
@Test
|
||||
void sendEmailMessage() {
|
||||
messageProducer.sendEmailMessage(new Message("hello@example.com"));
|
||||
void sendEmailMessage() throws InterruptedException { // 测试用例:验证电子邮件消息发送功能
|
||||
messageProducer.sendEmailMessage(new Message("hello@example.com")); // 创建并发送电子邮件消息
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
|
||||
@Test
|
||||
void sendSmsMessage() {
|
||||
void sendSmsMessage() throws InterruptedException {
|
||||
messageProducer.sendSmsMessage(new Message("1234567890"));
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user