no message

This commit is contained in:
ranke
2026-01-13 09:30:43 +08:00
parent bdf211f44f
commit 605cff08c7

View File

@@ -37,7 +37,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.*;
public class SmsSendServiceImplTest extends BaseMockitoUnitTest {
public class MsgSendServiceImplTest extends BaseMockitoUnitTest {
@InjectMocks
private SmsSendServiceImpl smsSendService;
@@ -212,29 +212,29 @@ public class SmsSendServiceImplTest extends BaseMockitoUnitTest {
anyLong(), any(), anyList());
}
@Test
public void testCheckSmsTemplateValid_notExists() {
// 准备参数
String templateCode = randomString();
// mock 方法
// @Test
// public void testCheckSmsTemplateValid_notExists() {
// // 准备参数
// String templateCode = randomString();
// // mock 方法
//
// // 调用,并断言异常
// assertServiceException(() -> smsSendService.validateSmsTemplate(templateCode),
// SMS_SEND_TEMPLATE_NOT_EXISTS);
// }
// 调用,并断言异常
assertServiceException(() -> smsSendService.validateSmsTemplate(templateCode),
SMS_SEND_TEMPLATE_NOT_EXISTS);
}
@Test
public void testBuildTemplateParams_paramMiss() {
// 准备参数
SmsTemplateDO template = randomPojo(SmsTemplateDO.class,
o -> o.setParams(Lists.newArrayList("code")));
Map<String, Object> templateParams = new HashMap<>();
// mock 方法
// 调用,并断言异常
assertServiceException(() -> smsSendService.buildTemplateParams(template, templateParams),
SMS_SEND_MOBILE_TEMPLATE_PARAM_MISS, "code");
}
// @Test
// public void testBuildTemplateParams_paramMiss() {
// // 准备参数
// SmsTemplateDO template = randomPojo(SmsTemplateDO.class,
// o -> o.setParams(Lists.newArrayList("code")));
// Map<String, Object> templateParams = new HashMap<>();
// // mock 方法
//
// // 调用,并断言异常
// assertServiceException(() -> smsSendService.buildTemplateParams(template, templateParams),
// SMS_SEND_MOBILE_TEMPLATE_PARAM_MISS, "code");
// }
@Test
public void testCheckMobile_notExists() {