-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BE] refactor: 필수 질문이 아닌 경우 최소 글자수 제한 제거 #589
[BE] refactor: 필수 질문이 아닌 경우 최소 글자수 제한 제거 #589
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수정 사항 한 가지 남겨두고 어프룹 드립니다 👍🏻
} | ||
|
||
if (!question.isRequired() && answerLength > MAX_LENGTH) { | ||
throw new InvalidTextAnswerLengthException(question.getId(), answerLength, ZERO_LENGTH, MAX_LENGTH); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
로그에서만 사용되는 것이라면 Exception(QuestionId, length, maxLength)
생성자를 만들어 min이 0일 때로 사용하면 어떨까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
조하요 반영했습니다~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
어푸푸푸릅 드립니다~🥳 수고하셨습니다!!
if (question.isRequired() && (answerLength < MIN_LENGTH || answerLength > MAX_LENGTH)) { | ||
throw new InvalidTextAnswerLengthException(question.getId(), answerLength, MIN_LENGTH, MAX_LENGTH); | ||
} | ||
|
||
if (!question.isRequired() && answerLength > MAX_LENGTH) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 좋네요 이 함수 가독성 짱짱~
@Test | ||
void 선택_질문의_답변_길이가_유효하지_않으면_예외가_발생한다() { | ||
// given | ||
String content = "답".repeat(10001); | ||
Question savedQuestion = questionRepository.save(서술형_옵션_질문()); | ||
TextAnswer textAnswer = new TextAnswer(savedQuestion.getId(), content); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
테스트 코드도 잘 작성된 것 같아요😇
🚀 어떤 기능을 구현했나요 ?
🔥 어떻게 해결했나요 ?
📝 어떤 부분에 집중해서 리뷰해야 할까요?
📚 참고 자료, 할 말