Repository navigation
test: SecurityConfig 인가 매트릭스 검증 추가 - #236
Open
leejongyoung wants to merge 1 commit into
Open
leejongyoung wants to merge 1 commit into
leejongyoung wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
수정 사유 Reason for modification
수정된 소스 내용 Modified source
SecurityConfig인가 규칙을 검증하는 테스트가 없습니다. 규칙은 보안 PR로 자주 바뀌어 왔고 문서 불일치 사례도 있었습니다. 신규 테스트 1개만 추가하고 운영 코드는 바꾸지 않았습니다.SecurityConfigAuthorizationTest:SecurityConfig필터 체인을 그대로 통과시키는 DB 독립 테스트(@SpringBootTest+@AutoConfigureMockMvc, 선례EgovBBSManageApiControllerMissingArticleTest방식). 토큰은EgovJwtTokenUtil로 직접 만듭니다(spring-security-test의존성 추가 없음).SecurityConfig줄과 대조합니다(공개 GET 9개, 공개 whitelist(/auth/me제외: 컨트롤러가 직접 401 반환), 모든 명시 matcher,anyRequest). 요청 본문이 필요 없는 경로라 필터의 HTTP 상태(401/403 여부)만 봅니다.JUnit 테스트 JUnit tests
JUnit 테스트 JUnit tests
수동 테스트 Manual testing
mvn -B -ntp test -Dtest=SecurityConfigAuthorizationTest→Tests run: 150, Failures: 0, Errors: 0, Skipped: 0.전체:
mvn -B -ntp package -DexcludedGroups=browser→Tests run: 565, Failures: 0, Errors: 0, Skipped: 0, BUILD SUCCESS (JDK 21 로컬 실행).테스트 브라우저 Test Browser
해당 없음(백엔드 API·단위 테스트).