-
Notifications
You must be signed in to change notification settings - Fork 24
[조백선] sprint7 #211
New issue
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
base: 조백선
Are you sure you want to change the base?
The head ref may contain hidden characters: "\uC870\uBC31\uC120-sprint7"
[조백선] sprint7 #211
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MDC 적용하신 부분 진짜 잘하셨네요 ㅎㅎ 굳이 피드백 드릴 내용이 많이 없었어요.
궁금한 점만 리뷰 남겼습니다
* 요청마다 MDC에 컨텍스트 정보를 추가하는 인터셉터 | ||
*/ | ||
@Slf4j | ||
public class MDCLoggingInterceptor implements HandlerInterceptor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오..
} | ||
private final AuthService authService; | ||
|
||
@PostMapping(path = "login") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
앞에 / 붙여주세요~
@RestController | ||
@RequestMapping("/api/binaryContents") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
REST API 설계 원칙에 맞춰서 소문자로 작성해주세요
|
||
import lombok.Builder; | ||
|
||
@Builder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
굳이 빌더 안써도 되지 않을까요 생성자로
요구사항
기본
프로파일 기반 설정 관리
로그 관리
예외 처리 고도화
유효성 검사
Actuator
단위 테스트
슬라이스 테스트
레포지토리 레이어의 슬라이스 테스트를 작성하세요.
@DataJpaTest를 활용해 테스트를 구현하세요.
테스트 환경을 구성하는 프로파일을 구성하세요.
application-test.yaml을 생성하세요.
데이터소스는 H2 인메모리 데이터베이스를 사용하고, PostgreSQL 호환 모드로 설정하세요.
H2 데이터베이스를 위해 필요한 의존성을 추가하세요.
테스트 시작 시 스키마를 새로 생성하도록 설정하세요.
디버깅에 용이하도록 로그 레벨을 적절히 설정하세요.
테스트 실행 간 test 프로파일을 활성화 하세요.
JPA Audit 기능을 활성화 하기 위해 테스트 클래스에 @EnableJpaAuditing을 추가하세요.
주요 레포지토리(User, Channel, Message)의 주요 쿼리 메소드에 대해 각각 최소 2개 이상(성공, 실패)의 테스트 케이스를 작성하세요.
커스텀 쿼리 메소드
페이징 및 정렬 메소드
컨트롤러 레이어의 슬라이스 테스트를 작성하세요.
@WebMvcTest를 활용해 테스트를 구현하세요.
WebMvcTest에서 자동으로 등록되지 않는 유형의 Bean이 필요하다면 @import를 활용해 추가하세요.
주요 컨트롤러(User, Channel, Message)에 대해 최소 2개 이상(성공, 실패)의 테스트 케이스를 작성하세요.
MockMvc를 활용해 컨트롤러를 테스트하세요.
서비스 레이어를 모의(mock)하여 컨트롤러 로직만 테스트하세요.
JSON 응답을 검증하는 테스트를 포함하세요.
통합 테스트
심화
MDC를 활용한 로깅 고도화
Spring Boot Admin을 활용한 메트릭 가시화
테스트 커버리지 관리
주요 변경사항
스크린샷
멘토에게