Repository navigation
fix: 예약 시각 판단을 서버 시간대가 아닌 한국 시간 Clock으로 한다 - #142
Merged
Merged
Conversation
예약 서비스가 LocalDate.now()와 ZoneId.systemDefault()를 써서, UTC인 운영 컨테이너에서는 한국 시각으로 이미 지난 시간을 최대 9시간까지 예약하거나, 시작한 예약을 취소할 수 있었다. "오늘" 기준(예약 가능 기간, 지난/다가올 예약 구분)도 00~09시 사이에 하루 어긋났다. - 장부용이던 Asia/Seoul Clock 설정을 global/config/TimeConfig로 옮기고 예약 서비스에 주입한다. - 테스트용 MutableClock을 공용 테스트 패키지로 옮기고, 예약 테스트의 날짜도 한국 날짜로 계산한다.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 56 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
요약
예약 서비스가
LocalDate.now()·ZoneId.systemDefault()로 "지금"을 판단했다. 운영 컨테이너는 시간대 설정이 없어 UTC이므로 다음이 가능했다.변경
Clock빈(ledger/config/LedgerTimeConfig)을global/config/TimeConfig로 옮기고ReservationService에 주입한다. 장부 서비스는 타입으로 주입받고 있어 영향 없음.MutableClock을 공용 테스트 패키지로 옮기고, 예약 테스트의 날짜 계산을 한국 날짜로 바꿨다(UTC인 CI에서도 서버와 같은 "오늘").테스트
ReservationTimeZoneIntegrationTest3건: 한국 시각 09:30 기준 09:00 예약 거부(400), 10:00 예약 허용, 10:30에 10:00 예약 취소 거부(409)../gradlew test: 535건 중 534 통과, 1 스킵.