We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test환경에서는 인증 권한을 받기위해 pom.xml에서 security설정을 끄거나 @WIthMockUser를 써야하는데(401 에러 피하기위함) 저희는 @test 과함께 @WithMockUser를 사용하는것으로 하겠습니다
또한 controller 테스트에서 perform 부분에서
mockMvc.perform(post("/api/v1/users/join") .with(csrf())
이런식으로 with(csrf())를 쓰시면 403 에러가 해결됩니다.
참고 사이트 @WebMvcTest 에서 Spring Security 적용했을때 401/403 에러 발생
The text was updated successfully, but these errors were encountered:
No branches or pull requests
📄 필수 사항
test환경에서는 인증 권한을 받기위해 pom.xml에서 security설정을 끄거나 @WIthMockUser를 써야하는데(401 에러 피하기위함)
저희는 @test 과함께 @WithMockUser를 사용하는것으로 하겠습니다
또한 controller 테스트에서 perform 부분에서
이런식으로 with(csrf())를 쓰시면 403 에러가 해결됩니다.
참고 사이트
@WebMvcTest 에서 Spring Security 적용했을때 401/403 에러 발생
다른 의견이 있으시면 댓글 부탁드립니다!
The text was updated successfully, but these errors were encountered: