Commit 969bd9a7 authored by alex yao's avatar alex yao

fix: 更新会员邮箱检查邮箱号是否已被使用

parent 87b798a2
...@@ -79,7 +79,7 @@ public class MemberInfoServiceImpl extends BaseServiceImpl implements MemberInfo ...@@ -79,7 +79,7 @@ public class MemberInfoServiceImpl extends BaseServiceImpl implements MemberInfo
if (StringUtils.isNotBlank(memberInfoEntity.getEmail())) { if (StringUtils.isNotBlank(memberInfoEntity.getEmail())) {
CheckMemberInfoQueryCondition condition = new CheckMemberInfoQueryCondition(); CheckMemberInfoQueryCondition condition = new CheckMemberInfoQueryCondition();
condition.setMemberId(memberInfoEntity.getMemberId().longValue()); condition.setMemberId(memberInfoEntity.getMemberId().longValue());
condition.setMobilePhone(memberInfoEntity.getEmail()); condition.setEmail(memberInfoEntity.getEmail());
List<CheckMemberInfoQueryItem> checkMemberInfoQueryItems = bizMemberInfoService.checkMemberInfoIsExist(condition); List<CheckMemberInfoQueryItem> checkMemberInfoQueryItems = bizMemberInfoService.checkMemberInfoIsExist(condition);
if (CollectionUtils.isNotEmpty(checkMemberInfoQueryItems)) { if (CollectionUtils.isNotEmpty(checkMemberInfoQueryItems)) {
throw new I18nMessageException("exception/email.is.exist"); throw new I18nMessageException("exception/email.is.exist");
......
package cn.com.poc.user.aggregation;
import cn.com.poc.user.entity.MemberInfoEntity;
import cn.com.yict.framemax.core.i18n.I18nMessageException;
import cn.com.yict.framemax.core.spring.SingleContextInitializer;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.MockitoAnnotations;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(initializers = SingleContextInitializer.class)
@WebAppConfiguration
public class MemberInfoServiceTest {
@Resource
@InjectMocks
MemberInfoService memberInfoService;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
}
@Test(expected = I18nMessageException.class)
@Rollback
@Transactional
public void testUpdateMemberInfoWithEmail() {
MemberInfoEntity memberInfoEntity = new MemberInfoEntity();
memberInfoEntity.setEmail("alex.yao@superlinksoft.com");
memberInfoEntity.setMemberId(217);
memberInfoService.updateMemberInfo(memberInfoEntity);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment