Skip to content

Conversation

@jueunk617
Copy link
Collaborator

📌 개요

각 도메인에서 발생하는 이벤트들을 처리하는 EventListener에 대한 테스트 코드를 추가했습니다.

🔨 작업 내용

CommunityNotificationEventListenerTest

  • 댓글/대댓글 작성, 게시글/댓글 좋아요 이벤트 발생 시 알림이 정상적으로 생성되는지 테스트
  • 이벤트 발생 시 actor 또는 receiver가 존재하지 않는 경우 알림이 생성되지 않는 예외 케이스 검증

StudyNotificationEventListenerTest

  • 학습 기록 생성 및 일일 목표 달성 이벤트 발생 시 개인 알림이 생성되는지 테스트
  • 학습 시간에 관계없이 알림이 생성되는 것 확인
  • 이벤트 관련 유저가 존재하지 않는 경우 테스트

StudyRoomNotificationEventListenerTest

  • 스터디룸 공지사항 생성, 멤버 권한 변경, 멤버 추방, 방장 위임 이벤트에 대한 알림 생성 테스트
  • 공지사항의 경우, 해당 스터디룸 멤버 전원에게 알림이 가는지 NotificationService의 createRoomNotification 메서드 호출 확인
  • 권한 변경, 추방, 방장 위임의 경우, 특정 대상자에게만 개인 알림이 가는지 createPersonalNotification 메서드 호출 확인

공통 예외 처리 테스트

  • 모든 테스트 클래스에 NotificationService에서 예외가 발생하더라도, 이벤트 리스너가 예외를 전파하지 않고 정상 종료되는지 확인
  • assertThatCode(...).doesNotThrowAnyException()

🔗 관련 이슈

Closes #202

📝 참고 사항


✅ 체크리스트

  • 기능 동작 확인
  • 테스트 코드 작성
  • 문서/주석 추가 및 최신화

@github-actions github-actions bot changed the title Test: 알림 이벤트 리스너 단위 테스트 진행 Test: 알림 이벤트 리스너 단위 테스트 진행 (#202) Oct 7, 2025
@jueunk617 jueunk617 merged commit 14a756e into dev Oct 7, 2025
3 checks passed
@github-actions github-actions bot deleted the Test/202 branch October 7, 2025 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants