-
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.
test: 봉사자, 모집자 이메일 찾기 Controller 테스트 코드 추가 (#229)
- Loading branch information
1 parent
eba2660
commit a7de655
Showing
1 changed file
with
39 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,7 @@ | |
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.pawwithu.connectdog.domain.auth.dto.request.*; | ||
import com.pawwithu.connectdog.domain.auth.dto.response.EmailResponse; | ||
import com.pawwithu.connectdog.domain.auth.dto.response.IntermediaryNameResponse; | ||
import com.pawwithu.connectdog.domain.auth.dto.response.IntermediaryPhoneResponse; | ||
import com.pawwithu.connectdog.domain.auth.dto.response.VolunteerPhoneResponse; | ||
import com.pawwithu.connectdog.domain.auth.dto.response.*; | ||
import com.pawwithu.connectdog.domain.auth.service.AuthService; | ||
import com.pawwithu.connectdog.domain.auth.service.EmailService; | ||
import com.pawwithu.connectdog.domain.volunteer.entity.SocialType; | ||
|
@@ -169,4 +166,42 @@ void setUp() { | |
result.andExpect(status().isOk()); | ||
verify(authService, times(1)).isIntermediaryNameDuplicated(request); | ||
} | ||
|
||
@Test | ||
void 이동봉사자_이메일_찾기() throws Exception { | ||
//given | ||
VolunteerPhoneRequest request = new VolunteerPhoneRequest("01000001111"); | ||
VolunteerEmailResponse response = new VolunteerEmailResponse("[email protected]"); | ||
|
||
//when | ||
given(authService.findVolunteerEmail(request)).willReturn(response); | ||
ResultActions result = mockMvc.perform( | ||
post("/volunteers/search/email") | ||
.contentType(MediaType.APPLICATION_JSON) | ||
.content(objectMapper.writeValueAsString(request)) | ||
); | ||
|
||
//then | ||
result.andExpect(status().isOk()); | ||
verify(authService, times(1)).findVolunteerEmail(request); | ||
} | ||
|
||
@Test | ||
void 모집자_이메일_찾기() throws Exception { | ||
//given | ||
IntermediaryPhoneRequest request = new IntermediaryPhoneRequest("01000001111"); | ||
IntermediaryEmailResponse response = new IntermediaryEmailResponse("[email protected]"); | ||
|
||
//when | ||
given(authService.findIntermediaryEmail(request)).willReturn(response); | ||
ResultActions result = mockMvc.perform( | ||
post("/intermediaries/search/email") | ||
.contentType(MediaType.APPLICATION_JSON) | ||
.content(objectMapper.writeValueAsString(request)) | ||
); | ||
|
||
//then | ||
result.andExpect(status().isOk()); | ||
verify(authService, times(1)).findIntermediaryEmail(request); | ||
} | ||
} |