Skip to content

Commit

Permalink
rename: 에러 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Sangwook02 committed Jul 31, 2024
1 parent 2b8811e commit c9acc40
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void validateApplyStudy(Study study, List<StudyHistory> currentMemberStud
public void validateCancelStudyApply(Study study) {
// 스터디 수강신청 기간이 아닌 경우
if (!study.isApplicable()) {
throw new CustomException(STUDY_HISTORY_NOT_CANCELABLE);
throw new CustomException(STUDY_APPLY_NOT_CANCELABLE);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ public enum ErrorCode {
ASSIGNMENT_STUDY_CAN_NOT_INPUT_STUDY_TIME(HttpStatus.CONFLICT, "과제 스터디는 스터디 시간을 입력할 수 없습니다."),
STUDY_NOT_FOUND(HttpStatus.NOT_FOUND, "존재하지 않는 스터디입니다."),
STUDY_NOT_APPLICABLE(HttpStatus.CONFLICT, "스터디 신청기간이 아닙니다."),
STUDY_APPLY_NOT_CANCELABLE(HttpStatus.CONFLICT, "스터디 신청기간이 아니라면 취소할 수 없습니다."),

// StudyHistory
STUDY_HISTORY_NOT_FOUND(HttpStatus.NOT_FOUND, "존재하지 않는 스터디 수강 기록입니다."),
STUDY_HISTORY_DUPLICATE(HttpStatus.CONFLICT, "이미 해당 스터디를 신청했습니다."),
STUDY_HISTORY_ONGOING_ALREADY_EXISTS(HttpStatus.CONFLICT, "이미 진행중인 스터디가 있습니다."),
STUDY_HISTORY_NOT_CANCELABLE(HttpStatus.CONFLICT, "스터디 신청기간이 아니라면 취소할 수 없습니다."),

// Order
ORDER_NOT_FOUND(HttpStatus.NOT_FOUND, "주문이 존재하지 않습니다."),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.gdschongik.gdsc.domain.study.domain;

import static com.gdschongik.gdsc.global.common.constant.RecruitmentConstant.*;
import static com.gdschongik.gdsc.global.common.constant.StudyConstant.*;
import static com.gdschongik.gdsc.global.exception.ErrorCode.*;
import static org.assertj.core.api.Assertions.*;

Expand Down Expand Up @@ -95,7 +93,7 @@ class 스터디_수강신청_취소시 {
// when & then
assertThatThrownBy(() -> studyHistoryValidator.validateCancelStudyApply(study))
.isInstanceOf(CustomException.class)
.hasMessage(STUDY_HISTORY_NOT_CANCELABLE.getMessage());
.hasMessage(STUDY_APPLY_NOT_CANCELABLE.getMessage());
}
}
}

0 comments on commit c9acc40

Please sign in to comment.