Closed jkde7721 closed 3 weeks ago
Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.
Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard. Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
💻 구현 내용
@WebMvcTest
,MockMvc
사용)🗣️ For 리뷰어
기존
auth
,user
,hospital
도메인 및global.service
패키지 하위의 서비스 클래스들을 인터페이스로 추상화하는 작업을 진행했습니다.인터페이스 이름 + -Impl
형태혹시 추상화 누락된 부분있다면 코멘트 부탁드립니다.
기존에는
auth
,user
,hospital
도메인의 서비스 계층만 테스트 코드 작성 → 웹 계층도 테스트 코드 작성필터를 기반으로 인증, 인가 로직을 구현 →
SecurityTestConfig.class
별도로 정의하여 현재 프로젝트의 인증 및 인가 로직 테스트(따로 설정 클래스 정의하지 않으면 아예 스프링 시큐리티의 기본 설정이 자동 적용됨)SecurityControllerTestConfig.class
는 단순히 컨트롤러를 테스트하기 위해 기본 스프링 시큐리티 설정을 모두 해제하는 설정 클래스(단순히 Controller 클래스를 단위 테스트하기 위함 + 더미 인증 유저를 설정하기 위한 커스텀@WithMockTestUser
어노테이션과 함께 사용)참고 https://spring.io/guides/gs/testing-web https://ashok-s-nair.medium.com/java-unit-testing-a-spring-boot-rest-controller-4914a57c344d https://jiwondev.tistory.com/270 https://docs.spring.io/spring-security/reference/servlet/test/method.html
close #51