From 719cb67176a3e0c3becc3eef79e5e8763bccd127 Mon Sep 17 00:00:00 2001 From: yjjjwww Date: Tue, 20 Jun 2023 02:25:58 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20conflict=EA=B0=80=20=EB=B0=9C?= =?UTF-8?q?=EC=83=9D=ED=95=98=EB=8A=94=20=EC=BD=94=EB=93=9C=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../banggabgo/service/MyContentService.java | 3 -- .../controller/MyContentControllerTest.java | 43 +++++++++++-------- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/fab/banggabgo/service/MyContentService.java b/src/main/java/com/fab/banggabgo/service/MyContentService.java index 79426ce..838f3b7 100644 --- a/src/main/java/com/fab/banggabgo/service/MyContentService.java +++ b/src/main/java/com/fab/banggabgo/service/MyContentService.java @@ -5,7 +5,6 @@ import com.fab.banggabgo.dto.mycontent.FavoriteArticleDto; import com.fab.banggabgo.dto.mycontent.MyArticleDto; import com.fab.banggabgo.dto.mycontent.MyInfoDto; -import com.fab.banggabgo.dto.mycontent.PatchMyInfoDto; import com.fab.banggabgo.dto.mycontent.PatchMyInfoRequestDto; import com.fab.banggabgo.dto.mycontent.PatchMyInfoResultDto; import com.fab.banggabgo.dto.mycontent.PatchMyNicknameRequestDto; @@ -31,8 +30,6 @@ PostMyInfoImageResultDto postMyInfoImage(User user, PostMyInfoImageRequestDto dt throws IOException; PatchMyInfoResultDto patchMyInfo(User user, PatchMyInfoRequestDto form); - PatchMyInfoResultDto patchMyInfo(User user, PatchMyInfoDto form); - List getMyFromApplicantList(User user, Integer page, Integer size); List getMyToApplicantList(User user, Integer page, Integer size); diff --git a/src/test/java/com/fab/banggabgo/controller/MyContentControllerTest.java b/src/test/java/com/fab/banggabgo/controller/MyContentControllerTest.java index 55e69df..4dee4d6 100644 --- a/src/test/java/com/fab/banggabgo/controller/MyContentControllerTest.java +++ b/src/test/java/com/fab/banggabgo/controller/MyContentControllerTest.java @@ -12,6 +12,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.junit.jupiter.MockitoExtension; @@ -143,35 +144,39 @@ class applicantList { @Test @DisplayName("신청자리스트 - 성공") @WithMockUser - void successGetApplicantList() throws Exception{ + void successGetApplicantList() throws Exception { mockMvc.perform(get("/api/my/from-applicants?page=1&size=4") - .with(SecurityMockMvcRequestPostProcessors.csrf())) + .with(SecurityMockMvcRequestPostProcessors.csrf())) .andExpect(status().isOk()); } + @Test @DisplayName("신청자리스트 - 성공 페이지 누락") @WithMockUser - void successLostPageGetApplicantList() throws Exception{ + void successLostPageGetApplicantList() throws Exception { mockMvc.perform(get("/api/my/from-applicants?size=4") - .with(SecurityMockMvcRequestPostProcessors.csrf())) + .with(SecurityMockMvcRequestPostProcessors.csrf())) .andExpect(status().isOk()); } + @Test @DisplayName("신청자리스트 - 성공 사이즈 누락") @WithMockUser - void successLostSizeGetApplicantList() throws Exception{ + void successLostSizeGetApplicantList() throws Exception { mockMvc.perform(get("/api/my/from-applicants?page=1") - .with(SecurityMockMvcRequestPostProcessors.csrf())) + .with(SecurityMockMvcRequestPostProcessors.csrf())) .andExpect(status().isOk()); } + @Test @DisplayName("신청자리스트 - 실패 계정 누락") - void FailNonAuthGetApplicantList() throws Exception{ + void FailNonAuthGetApplicantList() throws Exception { mockMvc.perform(get("/api/my/from-applicants?page=1&size=4") - .with(SecurityMockMvcRequestPostProcessors.csrf())) + .with(SecurityMockMvcRequestPostProcessors.csrf())) .andExpect(status().isUnauthorized()); } } + @Nested @DisplayName("내가신청한 신청자리스트") class toApplicantList { @@ -179,35 +184,39 @@ class toApplicantList { @Test @DisplayName("신청한리스트 - 성공") @WithMockUser - void successGetApplicantList() throws Exception{ + void successGetApplicantList() throws Exception { mockMvc.perform(get("/api/my/to-applicants?page=1&size=4") - .with(SecurityMockMvcRequestPostProcessors.csrf())) + .with(SecurityMockMvcRequestPostProcessors.csrf())) .andExpect(status().isOk()); } + @Test @DisplayName("신청한리스트 - 성공 페이지 누락") @WithMockUser - void successLostPageGetApplicantList() throws Exception{ + void successLostPageGetApplicantList() throws Exception { mockMvc.perform(get("/api/my/to-applicants?size=4") - .with(SecurityMockMvcRequestPostProcessors.csrf())) + .with(SecurityMockMvcRequestPostProcessors.csrf())) .andExpect(status().isOk()); } + @Test @DisplayName("신청한리스트 - 성공 사이즈 누락") @WithMockUser - void successLostSizeGetApplicantList() throws Exception{ + void successLostSizeGetApplicantList() throws Exception { mockMvc.perform(get("/api/my/to-applicants?page=1") - .with(SecurityMockMvcRequestPostProcessors.csrf())) + .with(SecurityMockMvcRequestPostProcessors.csrf())) .andExpect(status().isOk()); } + @Test @DisplayName("신청한리스트 - 실패 계정 누락") - void FailNonAuthGetApplicantList() throws Exception{ + void FailNonAuthGetApplicantList() throws Exception { mockMvc.perform(get("/api/my/to-applicants?page=1&size=4") - .with(SecurityMockMvcRequestPostProcessors.csrf())) + .with(SecurityMockMvcRequestPostProcessors.csrf())) .andExpect(status().isUnauthorized()); } - + } + @Test @DisplayName("이미지 변경 테스트") @WithMockUser