Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poc
poc-api
Commits
969bd9a7
Commit
969bd9a7
authored
Nov 28, 2024
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 更新会员邮箱检查邮箱号是否已被使用
parent
87b798a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
1 deletion
+44
-1
MemberInfoServiceImpl.java
.../com/poc/user/aggregation/impl/MemberInfoServiceImpl.java
+1
-1
MemberInfoServiceTest.java
...va/cn/com/poc/user/aggregation/MemberInfoServiceTest.java
+43
-0
No files found.
src/main/java/cn/com/poc/user/aggregation/impl/MemberInfoServiceImpl.java
View file @
969bd9a7
...
...
@@ -79,7 +79,7 @@ public class MemberInfoServiceImpl extends BaseServiceImpl implements MemberInfo
if
(
StringUtils
.
isNotBlank
(
memberInfoEntity
.
getEmail
()))
{
CheckMemberInfoQueryCondition
condition
=
new
CheckMemberInfoQueryCondition
();
condition
.
setMemberId
(
memberInfoEntity
.
getMemberId
().
longValue
());
condition
.
set
MobilePhone
(
memberInfoEntity
.
getEmail
());
condition
.
set
Email
(
memberInfoEntity
.
getEmail
());
List
<
CheckMemberInfoQueryItem
>
checkMemberInfoQueryItems
=
bizMemberInfoService
.
checkMemberInfoIsExist
(
condition
);
if
(
CollectionUtils
.
isNotEmpty
(
checkMemberInfoQueryItems
))
{
throw
new
I18nMessageException
(
"exception/email.is.exist"
);
...
...
src/test/java/cn/com/poc/user/aggregation/MemberInfoServiceTest.java
0 → 100644
View file @
969bd9a7
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
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment