From 010c73ebf1d518c4319b6a324b43249159723dff Mon Sep 17 00:00:00 2001 From: gdrffg Date: Tue, 17 Dec 2024 16:11:39 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20MemberControllerMvcTest.java=20=EA=B4=80?= =?UTF-8?q?=EB=A0=A8=20=EC=97=90=EB=9F=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit memberService의 메서드 명이 변경 됨에 따라 발생한 에러를 수정했습니다. --- .../example/domain/member/MemberControllerMvcTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/test/java/org/example/domain/member/MemberControllerMvcTest.java b/app/src/test/java/org/example/domain/member/MemberControllerMvcTest.java index 7491add..738941e 100644 --- a/app/src/test/java/org/example/domain/member/MemberControllerMvcTest.java +++ b/app/src/test/java/org/example/domain/member/MemberControllerMvcTest.java @@ -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") @@ -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)) @@ -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)) @@ -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) @@ -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)