mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-01 02:38:43 +08:00 
			
		
		
		
	mall + pay:
1. 修复单元测试的报错
This commit is contained in:
		| @@ -84,6 +84,9 @@ class MailSendServiceImplTest extends BaseMockitoUnitTest { | ||||
|             o.setParams(Lists.newArrayList("code", "op")); | ||||
|         }); | ||||
|         when(mailTemplateService.getMailTemplateByCodeFromCache(eq(templateCode))).thenReturn(template); | ||||
|         String title = RandomUtils.randomString(); | ||||
|         when(mailTemplateService.formatMailTemplateContent(eq(template.getTitle()), eq(templateParams))) | ||||
|                 .thenReturn(title); | ||||
|         String content = RandomUtils.randomString(); | ||||
|         when(mailTemplateService.formatMailTemplateContent(eq(template.getContent()), eq(templateParams))) | ||||
|                 .thenReturn(content); | ||||
| @@ -101,7 +104,7 @@ class MailSendServiceImplTest extends BaseMockitoUnitTest { | ||||
|         assertEquals(mailLogId, resultMailLogId); | ||||
|         // 断言调用 | ||||
|         verify(mailProducer).sendMailSendMessage(eq(mailLogId), eq(user.getEmail()), | ||||
|                 eq(account.getId()), eq(template.getNickname()), eq(template.getTitle()), eq(content)); | ||||
|                 eq(account.getId()), eq(template.getNickname()), eq(title), eq(content)); | ||||
|     } | ||||
|  | ||||
|     @Test | ||||
| @@ -122,6 +125,9 @@ class MailSendServiceImplTest extends BaseMockitoUnitTest { | ||||
|             o.setParams(Lists.newArrayList("code", "op")); | ||||
|         }); | ||||
|         when(mailTemplateService.getMailTemplateByCodeFromCache(eq(templateCode))).thenReturn(template); | ||||
|         String title = RandomUtils.randomString(); | ||||
|         when(mailTemplateService.formatMailTemplateContent(eq(template.getTitle()), eq(templateParams))) | ||||
|                 .thenReturn(title); | ||||
|         String content = RandomUtils.randomString(); | ||||
|         when(mailTemplateService.formatMailTemplateContent(eq(template.getContent()), eq(templateParams))) | ||||
|                 .thenReturn(content); | ||||
| @@ -139,7 +145,7 @@ class MailSendServiceImplTest extends BaseMockitoUnitTest { | ||||
|         assertEquals(mailLogId, resultMailLogId); | ||||
|         // 断言调用 | ||||
|         verify(mailProducer).sendMailSendMessage(eq(mailLogId), eq(mail), | ||||
|                 eq(account.getId()), eq(template.getNickname()), eq(template.getTitle()), eq(content)); | ||||
|                 eq(account.getId()), eq(template.getNickname()), eq(title), eq(content)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @@ -161,6 +167,9 @@ class MailSendServiceImplTest extends BaseMockitoUnitTest { | ||||
|             o.setParams(Lists.newArrayList("code", "op")); | ||||
|         }); | ||||
|         when(mailTemplateService.getMailTemplateByCodeFromCache(eq(templateCode))).thenReturn(template); | ||||
|         String title = RandomUtils.randomString(); | ||||
|         when(mailTemplateService.formatMailTemplateContent(eq(template.getTitle()), eq(templateParams))) | ||||
|                 .thenReturn(title); | ||||
|         String content = RandomUtils.randomString(); | ||||
|         when(mailTemplateService.formatMailTemplateContent(eq(template.getContent()), eq(templateParams))) | ||||
|                 .thenReturn(content); | ||||
| @@ -178,7 +187,7 @@ class MailSendServiceImplTest extends BaseMockitoUnitTest { | ||||
|         assertEquals(mailLogId, resultMailLogId); | ||||
|         // 断言调用 | ||||
|         verify(mailProducer).sendMailSendMessage(eq(mailLogId), eq(mail), | ||||
|                 eq(account.getId()), eq(template.getNickname()), eq(template.getTitle()), eq(content)); | ||||
|                 eq(account.getId()), eq(template.getNickname()), eq(title), eq(content)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @@ -200,6 +209,9 @@ class MailSendServiceImplTest extends BaseMockitoUnitTest { | ||||
|             o.setParams(Lists.newArrayList("code", "op")); | ||||
|         }); | ||||
|         when(mailTemplateService.getMailTemplateByCodeFromCache(eq(templateCode))).thenReturn(template); | ||||
|         String title = RandomUtils.randomString(); | ||||
|         when(mailTemplateService.formatMailTemplateContent(eq(template.getTitle()), eq(templateParams))) | ||||
|                 .thenReturn(title); | ||||
|         String content = RandomUtils.randomString(); | ||||
|         when(mailTemplateService.formatMailTemplateContent(eq(template.getContent()), eq(templateParams))) | ||||
|                 .thenReturn(content); | ||||
|   | ||||
| @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.service.social; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | ||||
| import cn.iocoder.yudao.framework.social.core.YudaoAuthRequestFactory; | ||||
| import cn.iocoder.yudao.framework.test.core.ut.BaseDbAndRedisUnitTest; | ||||
| import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | ||||
| import cn.iocoder.yudao.module.system.api.social.dto.SocialUserBindReqDTO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserBindDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; | ||||
| @@ -35,7 +35,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; | ||||
| import static org.mockito.Mockito.*; | ||||
|  | ||||
| @Import(SocialUserServiceImpl.class) | ||||
| public class SocialUserServiceImplTest extends BaseDbAndRedisUnitTest { | ||||
| public class SocialUserServiceImplTest extends BaseDbUnitTest { | ||||
|  | ||||
|     @Resource | ||||
|     private SocialUserServiceImpl socialUserService; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 YunaiV
					YunaiV