Skip to content

Commit

Permalink
Merge pull request #166 from Funssion-SWM/resume
Browse files Browse the repository at this point in the history
chore: change method get to post in searching user profile api
  • Loading branch information
comolove authored Nov 1, 2023
2 parents 5ad2d92 + 1c38734 commit d76e4ed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/Funssion/Inforum/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class ProfileController {

private final ProfileService profileService;

@GetMapping
@PostMapping
public List<UserProfileForEmployer> searchUserProfilesForEmployer(
@RequestBody TechStackDto techStackDto
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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))
Expand Down

0 comments on commit d76e4ed

Please sign in to comment.