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.
Discodeit 프로젝트 - 기본 요구사항
1. 프로파일 기반 설정 관리
application-dev.yaml
,application-prod.yaml
파일 생성2. 로그 관리
@Slf4j
활용application.yaml
기본 로깅 레벨 설정 (info
)debug
info
logback-spring.xml
생성{프로젝트 루트}/.logs
3. 예외 처리 고도화
com.sprint.mission.discodeit.exception[.{도메인}]
ErrorCode
Enum 클래스 정의DiscodeitException
기본 예외 클래스 정의details
속성 포함UserException
,ChannelException
등UserNotFoundException
,UserAlreadyExistException
등NoSuchElementException
,IllegalArgumentException
등ErrorResponse
클래스 정의status
: HTTP 상태 코드exceptionType
: 발생 예외 클래스 이름@RestControllerAdvice
활용한 예외 처리4. 유효성 검사
@NotNull
,@NotBlank
,@Size
,@Email
등@Valid
사용MethodArgumentNotValidException
전역 처리5. Actuator
health
,info
,metrics
,loggers
/actuator/info
/actuator/metrics
/actuator/health
/actuator/loggers
6. 단위 테스트
create
,update
,delete
create(PUBLIC, PRIVATE)
,update
,delete
,findByUserId
create
,update
,delete
,findByChannelId
7. 슬라이스 테스트
@DataJpaTest
)application-test.yaml
)@EnableJpaAuditing
추가@WebMvcTest
)@Import
활용8. 통합 테스트
@SpringBootTest
활용@Transactional
활용해 독립적 실행