Skip to content

test: UserStampService 단위 테스트 추가 - #223

Merged
unam98 merged 1 commit into
devfrom
tests/user-stamp-service-unit-tests
Aug 5, 2026
Merged

test: UserStampService 단위 테스트 추가#223
unam98 merged 1 commit into
devfrom
tests/user-stamp-service-unit-tests

Conversation

@unam98

@unam98 unam98 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

작업 배경

  • 테스트 커버리지 확장 9단계. CourseService/RecordService/ScrapService가 공통으로 의존하는 UserStampService(스탬프 발급/레벨업 로직) 자체는 지금까지 직접 테스트된 적이 없었음.

변경 사항

영역 내용
UserStampServiceTest createStampByUser/findUserStamps 전체에 대해 정상/경계값 테스트 15개 신규

버그는 발견되지 않음. 설계상 암묵적 계약 하나를 테스트로 문서화: createStampByUser(user, stampType)c/s/r/u 같은 "타입 마커" 값으로만 호출해야 하고, c1/s2처럼 이미 레벨이 붙은 StampType으로 호출하면 내부 switch가 매치되지 않아 예외 없이 조용히 무시됨.

영향 범위

  • 테스트 코드만 추가, 프로덕션 코드 변경 없음. 런타임 영향 없음.

검증 매트릭스

영향 범위 테스트 코드
코스 활동 기준(1/10/30개) 스탬프 발급 코스_1개_c1
코스_10개_c2
코스_30개_c3
활동카운트_0
기준개수가_아니면_생성안함
활동 타입별(스크랩/기록/업로드) 분기 스크랩_타입
기록_타입
업로드_타입
잘못된 stampType 호출 시 암묵적 계약 문서화 레벨_붙은_타입으로_호출하면_무시됨
레벨업 조건(4의 배수, 12개 상한) 스탬프_4개면_레벨업
스탬프_8개면_레벨3
스탬프_12_초과면_레벨업_안함
배수가_아니면_레벨업_안함
유저 스탬프 목록 조회 정상_조회
존재하지_않는_유저

Test Plan

  • 로컬에서 15개 전부 통과
  • 전체 테스트(179개) 함께 실행해도 간섭 없음 확인
  • 로컬 DB/Redis 띄우고 ./gradlew build 전체(ServerApplicationTests 포함) 통과 확인

🤖 Generated with Claude Code

createStampByUser/findUserStamps 전체에 대해 정상 케이스 + 경계값
검증 (15개). 코스/스크랩/기록/업로드 4개 활동 타입 각각의 스탬프
기준(1/10/30개)과 레벨업 조건(스탬프 4의 배수, 12개 상한)을 검증.

버그는 발견되지 않음. 다만 설계상 암묵적 계약 하나를 테스트로
명시해둠: createStampByUser(user, stampType)는 반드시 c/s/r/u 같은
"타입 마커" 값으로 호출해야 하고, c1/s2처럼 이미 레벨이 붙은
StampType으로 호출하면 getActivityCount의 switch가 매치되지 않아
조용히 무시됨 (예외 없음).
@unam98 unam98 self-assigned this Aug 5, 2026
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@unam98, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9ab1a2b3-25de-4ae6-b15f-ea95e5455037

📥 Commits

Reviewing files that changed from the base of the PR and between c36c28b and c0a1636.

📒 Files selected for processing (1)
  • src/test/java/org/runnect/server/user/service/UserStampServiceTest.java

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@unam98
unam98 merged commit 75b8524 into dev Aug 5, 2026
2 checks passed
@unam98
unam98 deleted the tests/user-stamp-service-unit-tests branch August 5, 2026 11:28
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.

2 participants