From 1c38734c6feb9b5d739b0b7c215ddc35048f7d9a Mon Sep 17 00:00:00 2001 From: comolove Date: Wed, 1 Nov 2023 11:44:29 +0900 Subject: [PATCH] chore: change method get to post in searching user profile api --- src/main/java/Funssion/Inforum/config/SecurityConfig.java | 2 +- .../domain/profile/controller/ProfileController.java | 2 +- .../Inforum/domain/profile/ProfileIntegrationTest.java | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/Funssion/Inforum/config/SecurityConfig.java b/src/main/java/Funssion/Inforum/config/SecurityConfig.java index 6c5a6d8e..7ef1401d 100644 --- a/src/main/java/Funssion/Inforum/config/SecurityConfig.java +++ b/src/main/java/Funssion/Inforum/config/SecurityConfig.java @@ -66,7 +66,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti .requestMatchers(HttpMethod.POST,"/users").permitAll() .requestMatchers(HttpMethod.POST,"/users/employer").permitAll() .requestMatchers(HttpMethod.GET,"/users/employer").hasRole(EMPLOYER.toString()) - .requestMatchers(HttpMethod.GET, "/users/profile").hasRole(EMPLOYER.toString()) + .requestMatchers(HttpMethod.POST, "/users/profile").hasRole(EMPLOYER.toString()) //users 포함한 end point 보안 적용 .requestMatchers(HttpMethod.GET,"/users/**").permitAll() .requestMatchers("/users/authenticate-email", diff --git a/src/main/java/Funssion/Inforum/domain/profile/controller/ProfileController.java b/src/main/java/Funssion/Inforum/domain/profile/controller/ProfileController.java index 9cb9d7e8..9b271bdf 100644 --- a/src/main/java/Funssion/Inforum/domain/profile/controller/ProfileController.java +++ b/src/main/java/Funssion/Inforum/domain/profile/controller/ProfileController.java @@ -20,7 +20,7 @@ public class ProfileController { private final ProfileService profileService; - @GetMapping + @PostMapping public List searchUserProfilesForEmployer( @RequestBody TechStackDto techStackDto ) { diff --git a/src/test/java/Funssion/Inforum/domain/profile/ProfileIntegrationTest.java b/src/test/java/Funssion/Inforum/domain/profile/ProfileIntegrationTest.java index 440c8702..6eb60c9d 100644 --- a/src/test/java/Funssion/Inforum/domain/profile/ProfileIntegrationTest.java +++ b/src/test/java/Funssion/Inforum/domain/profile/ProfileIntegrationTest.java @@ -116,12 +116,12 @@ void init() throws JsonProcessingException { @Test @DisplayName("로그인, 채용자 인지 검증") void validateAuth() throws Exception { - mvc.perform(get("/users/profile") + mvc.perform(post("/users/profile") .contentType(MediaType.APPLICATION_JSON) .content(requestTechStackForm)) .andExpect(status().isUnauthorized()); - mvc.perform(get("/users/profile") + mvc.perform(post("/users/profile") .with(user(createdMember1.getId().toString())) .contentType(MediaType.APPLICATION_JSON) .content(requestTechStackForm)) @@ -131,7 +131,7 @@ void validateAuth() throws Exception { @Test @DisplayName("정상 조회") void success() throws Exception { - mvc.perform(get("/users/profile") + mvc.perform(post("/users/profile") .with(user(mockEmployerUserDetails)) .contentType(MediaType.APPLICATION_JSON) .content(requestTechStackForm))