Skip to content

[FIX] 인기작 집계 후보가 없을 때 기존 인기작을 유지한다 - #644

Merged
ljy1348 merged 1 commit into
devfrom
fix/#643
Oct 19, 2026
Merged

ljy1348 merged 1 commit into
devfrom
fix/#643

Conversation

@ljy1348

@ljy1348 ljy1348 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Related Issue

  • fix/#ISSUE_NUMBER -> dev
  • Closes #ISSUE_NUMBER

Key Changes

최근 7일간의 집계 후보가 없으면 기존 인기작까지 삭제되던 문제를 수정했습니다. topNovelIds가 비어 있으면 조기 반환하여 마지막 인기작을 유지합니다. 후보가 있으면 새 인기작을 저장한 뒤 기존 행을 삭제합니다.

  • PopularNovelSchedulerTest: 단위 테스트 6건을 추가했습니다. 기존 인기작 유무에 따른 조기 반환, 새 데이터 저장 후 기존 데이터 삭제 순서, 후보 조회·저장 실패 시 삭제 방지를 검증합니다.
  • PopularNovelSchedulerIntegrationTest: DB 통합 테스트 7건을 추가했습니다. 임시 인기작·사용자·작품·서재 데이터를 넣고 실제 JPA/QueryDSL 경로로 스케줄러를 실행한 뒤, flush·clear 후 DB를 재조회하여 결과를 검증합니다.
  • DB 테스트에서 신규 후보 저장과 이전 행 삭제, 후보가 없을 때 기존 PK·작품 ID 유지, 갱신 성공 후 후보가 사라지는 연속 실행, 반복 실행 시 중복 방지, 최초 저장, 최근 7일·독서 상태 조건, 상위 30개 제한을 확인합니다.
  • 테스트 전용 H2 의존성과 설정을 추가했습니다. MySQL 호환 모드의 메모리 DB를 사용하며, Redis 연결과 자동 스케줄 실행 없이 테스트합니다. 임시 데이터는 각 테스트 종료 시 롤백합니다.

To Reviewers

빈 후보 여부는 최근 7일간의 집계 쿼리 결과를 기준으로 판단합니다. 후보가 없으면 기존 인기작 전체를 유지하고, 한 건 이상이면 새 집계 결과로 교체합니다.

References

  • 단위 테스트: src/test/java/org/websoso/WSSServer/application/PopularNovelSchedulerTest.java
  • DB 통합 테스트: src/test/java/org/websoso/WSSServer/application/PopularNovelSchedulerIntegrationTest.java
  • DB 테스트 설정: src/test/resources/application-popular-novel-test.properties

빈 집계 결과의 조기 반환과 인기작 교체를 단위 테스트 및 H2 DB 통합 테스트로 검증한다.

Refs #643
@ljy1348 ljy1348 linked an issue Oct 19, 2026 that may be closed by this pull request
5 tasks
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T11:27:36.986700Z a202c6f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@GiJungPark GiJungPark left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

확인했어요~

@ljy1348
ljy1348 merged commit 643ba96 into dev Oct 19, 2026
2 checks passed
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.

[FIX] 인기작 집계 후보가 없을 때 기존 인기작 유지

2 participants