Skip to content

feat: chapter clear cookie/#654#657

Merged
chaeyn merged 3 commits into
developfrom
feat/chapter-clear-cookie/#654
Apr 11, 2026
Merged

feat: chapter clear cookie/#654#657
chaeyn merged 3 commits into
developfrom
feat/chapter-clear-cookie/#654

Conversation

@Finefinee

Copy link
Copy Markdown
Member

변경사항

  • 로드맵 관련 쿠기 지급 감소 (챕터 -> 100, 섹션 -> 1000)

관련 이슈

Closes #

추가 컨텍스트

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request reduces the cookie rewards for clearing chapters and sections in the roadmap V2 system from 300 to 100 and 3000 to 1000, respectively. The associated unit tests have been updated to reflect these new reward values. The review suggests improving the readability and maintainability of the tests by replacing magic numbers with explicit calculations or local constants for reward values.

assertThat(result.isChapterCleared()).isTrue();
assertThat(result.nextChapterId()).isEqualTo(21L);
assertThat(userCaptor.getValue().totalCookie()).isEqualTo(1300);
assertThat(userCaptor.getValue().totalCookie()).isEqualTo(1100);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

매직 넘버 1100은 테스트의 의도를 파악하기 어렵게 만듭니다. 초기 쿠키 값(1000)과 챕터 클리어 보상(100)을 더하는 형태로 1000 + 100과 같이 명시적으로 작성하면 가독성과 유지보수성이 향상됩니다.

Suggested change
assertThat(userCaptor.getValue().totalCookie()).isEqualTo(1100);
assertThat(userCaptor.getValue().totalCookie()).isEqualTo(1000 + 100);

Comment on lines +141 to 147
assertThat(userCaptor.getValue().totalCookie()).isEqualTo(1600);
assertThat(historyCaptor.getAllValues())
.extracting(UserGoodsHistory::goodsActingCategory, UserGoodsHistory::variation)
.containsExactly(
org.assertj.core.groups.Tuple.tuple(GoodsActingCategory.ROADMAP_V2_CHAPTER_REWARD, 300),
org.assertj.core.groups.Tuple.tuple(GoodsActingCategory.ROADMAP_V2_SECTION_REWARD, 3000)
org.assertj.core.groups.Tuple.tuple(GoodsActingCategory.ROADMAP_V2_CHAPTER_REWARD, 100),
org.assertj.core.groups.Tuple.tuple(GoodsActingCategory.ROADMAP_V2_SECTION_REWARD, 1000)
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

테스트에 사용된 매직 넘버(1600, 100, 1000)는 코드의 가독성과 유지보수성을 저해합니다. 보상 값을 지역 상수로 선언하고, 이를 사용하여 예상 결과를 계산하는 방식으로 리팩터링하는 것을 권장합니다. 이렇게 하면 테스트의 의도가 명확해지고 향후 보상 값이 변경될 때 수정이 용이해집니다.

        final int chapterReward = 100;
        final int sectionReward = 1000;
        assertThat(userCaptor.getValue().totalCookie()).isEqualTo(500 + chapterReward + sectionReward);
        assertThat(historyCaptor.getAllValues())
                .extracting(UserGoodsHistory::goodsActingCategory, UserGoodsHistory::variation)
                .containsExactly(
                        org.assertj.core.groups.Tuple.tuple(GoodsActingCategory.ROADMAP_V2_CHAPTER_REWARD, chapterReward),
                        org.assertj.core.groups.Tuple.tuple(GoodsActingCategory.ROADMAP_V2_SECTION_REWARD, sectionReward)
                );

@hjbin-25 hjbin-25 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.

수고하셨습니다

@chaeyn chaeyn merged commit 69f18a5 into develop Apr 11, 2026
1 check passed
@chaeyn chaeyn deleted the feat/chapter-clear-cookie/#654 branch April 11, 2026 03:09
@Finefinee Finefinee added the enhancement 새로운 기능 추가 label Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement 새로운 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants