Skip to content

Commit

Permalink
refactor: 불분명한 예외 메세지, 에러코드 수
Browse files Browse the repository at this point in the history
  • Loading branch information
ikjo39 committed Aug 6, 2024
1 parent 31278a3 commit 15a21a2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public enum MeetingErrorCode implements ErrorCodeType {
NOT_FOUND_MEETING(HttpStatus.NOT_FOUND, "존재하지 않는 약속 정보 입니다."),
INVALID_TIME_RANGE(HttpStatus.BAD_REQUEST, "끝 시간은 시작 시간 이후가 되어야 합니다."),
MEETING_LOCKED(HttpStatus.BAD_REQUEST, "약속이 잠겨있어 수행할 수 없습니다."),
NOT_AVAILABLE_MEETING(HttpStatus.BAD_REQUEST, "약속 생성이 불가능한 날짜입니다.");
PAST_NOT_PERMITTED(HttpStatus.BAD_REQUEST, "과거 날짜로는 약속을 생성할 수 없습니다.");

private final HttpStatus httpStatus;
private final String message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private Meeting saveMeeting(String meetingName, LocalTime startTime, LocalTime e
private void saveAvailableDates(List<LocalDate> dates, Meeting meeting, LocalDate date) {
AvailableDates availableDates = new AvailableDates(dates, meeting);
if (availableDates.isAnyBefore(date)) {
throw new MomoException(MeetingErrorCode.NOT_AVAILABLE_MEETING);
throw new MomoException(MeetingErrorCode.PAST_NOT_PERMITTED);
}
availableDateRepository.saveAll(availableDates.getAvailableDates());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ void throwExceptionWhenDatesHavePast() {
//when //then
assertThatThrownBy(() -> meetingService.create(request))
.isInstanceOf(MomoException.class)
.hasMessage(MeetingErrorCode.NOT_AVAILABLE_MEETING.message());
.hasMessage(MeetingErrorCode.PAST_NOT_PERMITTED.message());
}

@DisplayName("약속을 잠그면 잠금 상태가 변경된다.")
Expand Down

0 comments on commit 15a21a2

Please sign in to comment.