From 34715ad0949965c7eb8ab9aa8dccf596f256aa51 Mon Sep 17 00:00:00 2001 From: kyeong-hyeok Date: Wed, 22 Nov 2023 14:41:54 +0900 Subject: [PATCH] =?UTF-8?q?test:=20=EC=9D=B4=EB=8F=99=EB=B4=89=EC=82=AC=20?= =?UTF-8?q?=EC=8B=A0=EC=B2=AD=20=EC=B7=A8=EC=86=8C,=20=EC=8A=B9=EC=9D=B8,?= =?UTF-8?q?=20=EB=B0=98=EB=A0=A4,=20=EB=B4=89=EC=82=AC=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C=20Controller=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95=20(#141)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ApplicationControllerTest.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/test/java/com/pawwithu/connectdog/domain/application/controller/ApplicationControllerTest.java b/src/test/java/com/pawwithu/connectdog/domain/application/controller/ApplicationControllerTest.java index d9adc1e4..cfaad04d 100644 --- a/src/test/java/com/pawwithu/connectdog/domain/application/controller/ApplicationControllerTest.java +++ b/src/test/java/com/pawwithu/connectdog/domain/application/controller/ApplicationControllerTest.java @@ -135,14 +135,16 @@ void setUp() { void 이동봉사_신청_취소() throws Exception { //given Long applicationId = 1L; + ApplicationSuccessResponse response = new ApplicationSuccessResponse(true); //when + given(applicationService.deleteApplication(anyString(), anyLong())).willReturn(response); ResultActions result = mockMvc.perform( delete("/volunteers/applications/{applicationId}", applicationId) ); //then - result.andExpect(status().isNoContent()); + result.andExpect(status().isOk()); verify(applicationService, times(1)).deleteApplication(anyString(), anyLong()); } @@ -150,14 +152,16 @@ void setUp() { void 이동봉사_신청_승인() throws Exception { //given Long applicationId = 1L; + ApplicationSuccessResponse response = new ApplicationSuccessResponse(true); //when + given(applicationService.confirmApplication(anyString(), anyLong())).willReturn(response); ResultActions result = mockMvc.perform( patch("/intermediaries/applications/{applicationId}", applicationId) ); //then - result.andExpect(status().isNoContent()); + result.andExpect(status().isOk()); verify(applicationService, times(1)).confirmApplication(anyString(), anyLong()); } @@ -165,14 +169,16 @@ void setUp() { void 이동봉사_신청_반려() throws Exception { //given Long applicationId = 1L; + ApplicationSuccessResponse response = new ApplicationSuccessResponse(true); //when + given(applicationService.cancelApplication(anyString(), anyLong())).willReturn(response); ResultActions result = mockMvc.perform( delete("/intermediaries/applications/{applicationId}", applicationId) ); //then - result.andExpect(status().isNoContent()); + result.andExpect(status().isOk()); verify(applicationService, times(1)).cancelApplication(anyString(), anyLong()); } @@ -306,17 +312,19 @@ void setUp() { } @Test - void 이동봉사_완료() throws Exception { + void 이동봉사_완료하기() throws Exception { //given Long applicationId = 1L; + ApplicationSuccessResponse response = new ApplicationSuccessResponse(true); //when + given(applicationService.completeApplication(anyString(), anyLong())).willReturn(response); ResultActions result = mockMvc.perform( patch("/intermediaries/applications/{applicationId}/completed", applicationId) ); //then - result.andExpect(status().isNoContent()); + result.andExpect(status().isOk()); verify(applicationService, times(1)).completeApplication(anyString(), anyLong()); }