Skip to content

Commit

Permalink
fix: MemberControllerMvcTest.java 관련 에러 수정
Browse files Browse the repository at this point in the history
memberService의 메서드 명이 변경 됨에 따라 발생한 에러를 수정했습니다.
  • Loading branch information
KanuBang committed Dec 17, 2024
1 parent bbc4520 commit 010c73e
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void joinMemberSuccess() throws Exception {

//Given
MemberForm validMemberForm = createValidMemberForm();
Mockito.when(memberService.save(validMemberForm)).thenReturn(createMember(validMemberForm));
Mockito.when(memberService.addMember(validMemberForm)).thenReturn(createMember(validMemberForm));

//When, Then
mockMvc.perform(post("/profile/add")
Expand Down Expand Up @@ -85,7 +85,7 @@ void findMemberTestSuccess() throws Exception {

//Given
Member member = createMember(createValidMemberForm());
Mockito.when(memberService.getMember(1L)).thenReturn(member);
Mockito.when(memberService.findMember(1L)).thenReturn(member);

//When, Then
mockMvc.perform(get("/profile/{user_id}", 1L))
Expand All @@ -105,7 +105,7 @@ void findMemberTestSuccess() throws Exception {
@DisplayName("사용자 프로필 조회 테스트 - 실패")
void findMemberTestFail() throws Exception {
//Given
Mockito.when(memberService.getMember(2L)).thenReturn(null);
Mockito.when(memberService.findMember(2L)).thenReturn(null);

//When, Then
mockMvc.perform(get("/profile/{user_id}", 2L))
Expand All @@ -120,7 +120,7 @@ void editMemberTestSuccess() throws Exception {
Member member = createMember(createValidMemberForm());
MemberEditForm editForm = createValidMemberEditForm();

Mockito.when(memberService.updateMember(1L, editForm)).thenReturn(member.editMember(editForm));
Mockito.when(memberService.modifyMember(1L, editForm)).thenReturn(member.editMember(editForm));

// When, Then
mockMvc.perform(put("/profile/{user_id}/edit", 1L)
Expand Down Expand Up @@ -160,7 +160,7 @@ void editMemberTestInvalidFail() throws Exception {
@DisplayName("사용자 프로필 수정 테스트 - 회원 조회 실패")
void editMemberTestNotFoundFail() throws Exception {
MemberEditForm validMemberEditForm = createValidMemberEditForm();
Mockito.when(memberService.getMember(2L)).thenReturn(null);
Mockito.when(memberService.findMember(2L)).thenReturn(null);

// When, Then
mockMvc.perform(put("/profile/{user_id}/edit", 1L)
Expand Down

0 comments on commit 010c73e

Please sign in to comment.