Skip to content
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

[fix #190] 답변자가 스스로에게 채팅 요청 보낼 수 없도록 수정 #192

Merged
merged 4 commits into from
Jan 14, 2025

Conversation

hyun2371
Copy link
Member

관련 이슈

📑 작업 상세 내용

  • 답변자와 채팅 요청자 아이디 비교해 같으면 예외 발생
  • 예외 테스트에서 불필요한 크레딧 설정 코드 제거

💫 작업 요약

🔍 중점적으로 리뷰 할 부분

@hyun2371 hyun2371 added the 🚨 fix 오류 수정 label Jan 14, 2025
@hyun2371 hyun2371 requested a review from dudxo January 14, 2025 08:22
@hyun2371 hyun2371 self-assigned this Jan 14, 2025
Copy link

github-actions bot commented Jan 14, 2025

Code Coverage

Overall Project 84.5% 🍏
Files changed 100% 🍏

File Coverage
ChatInquiryService.java 94.12% 🍏

Copy link

github-actions bot commented Jan 14, 2025

Test Results

 28 files   28 suites   14s ⏱️
143 tests 141 ✅ 2 💤 0 ❌
144 runs  142 ✅ 2 💤 0 ❌

Results for commit a672fd5.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@dudxo dudxo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

빠른 QA 수정 수고하셨습니다!

if (!answerRepository.existsByQuestionPostIdAndMember(questionPostId, answerer)) {
throw new ValidationException(ChatInquiryErrorCode.NOT_EXISTS_ANSWERER);
}
if (Objects.equals(answerer.getId(), inquirerId)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

필수적인건 아니지만 2가지 메서드로 분리해도 좋을 것 같아요!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 분리했습니다!

@@ -173,6 +172,32 @@ void createChatInquiry_fails2() {
.hasMessageContaining(ChatInquiryErrorCode.NOT_EXISTS_ANSWERER.getMessage());
}

@DisplayName("[답변자는 스스로에게 채팅 요청을 할 수 없다.]")
@Test
void createChatInquiry_fails3() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

실패 테스트 케이스 작성 👍 👍

@hyun2371 hyun2371 merged commit c0bf1ab into dev Jan 14, 2025
3 checks passed
@hyun2371 hyun2371 deleted the fix/#190/block-self-inquiry branch January 14, 2025 11:55
dudxo pushed a commit that referenced this pull request Jan 14, 2025
* [feat] : 채팅 요청 에러 코드 추가

* [feat] : 채팅 요청 에러 검증 로직 추가

* [test] : 채팅 요청 에러 검증 로직 테스트

* [refactor] : 검증 로직 함수 추출
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 fix 오류 수정
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🚨 답변자가 스스로에게 채팅 요청 보낼 수 없도록 수정
2 participants