-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #239 from PawWithU/feat/238-email-duplicated-modify
[Feature] 봉사자, 모집자 이메일 중복 가능하도록 변경
- Loading branch information
Showing
6 changed files
with
61 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,21 +50,39 @@ void setUp() { | |
.build(); | ||
} | ||
@Test | ||
void 이메일_인증번호_전송() throws Exception{ | ||
void 봉사자_이메일_인증번호_전송() throws Exception{ | ||
//given | ||
EmailRequest request = new EmailRequest("[email protected]"); | ||
EmailResponse response = new EmailResponse("authCode123"); | ||
|
||
//when | ||
when(emailService.sendEmail(any())).thenReturn(response); | ||
when(emailService.sendEmailToVolunteer(any())).thenReturn(response); | ||
ResultActions result = mockMvc.perform( | ||
post("/volunteers/sign-up/email") | ||
.contentType(MediaType.APPLICATION_JSON) | ||
.content(objectMapper.writeValueAsString(request)) | ||
); | ||
//then | ||
result.andExpect(status().isOk()); | ||
verify(emailService, times(1)).sendEmail(any()); | ||
verify(emailService, times(1)).sendEmailToVolunteer(any()); | ||
} | ||
|
||
@Test | ||
void 모집자_이메일_인증번호_전송() throws Exception{ | ||
//given | ||
EmailRequest request = new EmailRequest("[email protected]"); | ||
EmailResponse response = new EmailResponse("authCode123"); | ||
|
||
//when | ||
when(emailService.sendEmailToIntermediary(any())).thenReturn(response); | ||
ResultActions result = mockMvc.perform( | ||
post("/intermediaries/sign-up/email") | ||
.contentType(MediaType.APPLICATION_JSON) | ||
.content(objectMapper.writeValueAsString(request)) | ||
); | ||
//then | ||
result.andExpect(status().isOk()); | ||
verify(emailService, times(1)).sendEmailToIntermediary(any()); | ||
} | ||
|
||
|
||
|