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