Merged
Conversation
…ture/reservation-manage
- DailySlotCapacity 업데이트 구조에 따른 코드 수정
# Conflicts: # src/main/java/com/reservation/tablereservationservice/application/reservation/service/ReservationService.java # src/main/java/com/reservation/tablereservationservice/domain/reservation/ReservationRepository.java # src/main/java/com/reservation/tablereservationservice/infrastructure/reservation/repository/JpaReservationRepository.java # src/main/java/com/reservation/tablereservationservice/presentation/reservation/controller/ReservationController.java # src/test/java/com/reservation/tablereservationservice/application/reservation/service/ReservationServiceIntegrationTest.java # src/test/java/com/reservation/tablereservationservice/application/reservation/service/ReservationServiceTest.java
- 테스트 기준 날짜를 고정값(2030-01-01)으로 통일 - 단위 테스트에서 식별자(id)를 명시적으로 주입하도록 fixture 정리 - 테스트 간 id 충돌 및 null 문제를 방지하도록 restaurant / slot / reservation fixture 보완 - 예약 취소 로직 추가에 따라 예약 목록 조회 테스트를 기간/상태 필터링 케이스로 확장
blue000927
reviewed
Feb 4, 2026
blue000927
left a comment
There was a problem hiding this comment.
프로덕션 코드는 어느정도 감을 잡으신 것 같아서 좋네요!
테스트 코드의 경우 당연히 많이 짜면 많이 짤수록 좋지만 어느정도 가성비를 따진다면, 서비스 레이어는 모킹 대신 통합 테스트 정도로만 짜도 괜찮다고 생각해요 :)
TestFixture로 분리, 도메인 단위 테스트, 서비스 통합 테스트, 컨트롤러 통합 테스트 이런 셈이죠!
해당 PR에 컨트롤러 테스트도 그대로 올려주시면 금방 어프로브 가능할듯싶네요.
Comment on lines
+248
to
+260
| private void validateCancelable(Long userId, Reservation reservation) { | ||
| if (!reservation.getUserId().equals(userId)) { | ||
| throw new ReservationException(ErrorCode.RESERVATION_FORBIDDEN); | ||
| } | ||
|
|
||
| if (reservation.getStatus() == ReservationStatus.CANCELED) { | ||
| throw new ReservationException(ErrorCode.RESERVATION_ALREADY_CANCELED); | ||
| } | ||
|
|
||
| LocalDateTime cancelDeadline = reservation.getVisitAt().minusHours(24); | ||
| if (!LocalDateTime.now().isBefore(cancelDeadline)) { | ||
| throw new ReservationException(ErrorCode.RESERVATION_CANCEL_DEADLINE_PASSED); | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
넵, 취소 검증 로직을 Reservation 도메인으로 이동시켰습니다!
- 도메인은 boolean 결과만 반환하고 예외 처리는 서비스에서 담당 - 현재 시점(now)을 서비스에서 한 번만 생성하도록 개선
- 중복되는 서비스 단위 테스트 일부 제거
blue000927
approved these changes
Feb 5, 2026
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.
개요
메인 리뷰어 지정
리뷰 시 참고 사항
작업 시 고민사항
TODO
References
체크리스트
관련 이슈