package com.kwan.springbootkwan; import com.kwan.springbootkwan.entity.MailInfo; import com.kwan.springbootkwan.entity.User; import com.kwan.springbootkwan.mapper.UserMapper; import com.kwan.springbootkwan.service.ISendMsgHandle; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest public class UserServiceImplTest { @Autowired private UserMapper userService; @Autowired private ISendMsgHandle isSendMsgHandle; @Test public void queryAll() { User user = userService.selectById(1); System.out.println(user); } /** * 发邮件 */ @Test void sendSimpleTextEmail() { MailInfo mailInfo = new MailInfo(); mailInfo.setReceiver(new String[]{"qinyingjie@deepexi.com"}); mailInfo.setSubject("测试主题"); mailInfo.setContent("邮件内容"); isSendMsgHandle.sendSimpleTextEmail(mailInfo); } }