Skip to content

Conversation

@taek2222
Copy link
Contributor

@taek2222 taek2222 commented Dec 15, 2025

#️⃣ 이슈 번호

#36


🛠️ 작업 내용

  • 테스트 코드 중복 코드 개선 및 Context 재사용할 수 있도록 상위 클래스를 생성해 개선했습니다.

Notion 문서


🙇🏻 중점 리뷰 요청

  • SecurityConfigTest 클래스안에 @Import({TestSecurityConfig.class, SecurityConfig.class}) 코드가 존재했습니다. SecurityConfig.class는 왜 필요해서 선언했는 지 모르겠습니다. 이미 컨텍스트 로딩할 때 적용되고 있었습니다. 지금은 삭제한 상황이구요!

  • 기존 @MockitoBean 사용할 때 아래와 같이 FcmNotificationManager 인터페이스가 아닌 구현체에 의존하고 있었습니다. 이를 FestivalNotificationManager인터페이스로 변경했는데, 문제가 없겠죠? 🤔

@MockitoBean
    private FcmNotificationManager fcmNotificationManager;

📸 이미지 첨부 (Optional)

@coderabbitai
Copy link

coderabbitai bot commented Dec 15, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (3)
  • android
  • backend
  • frontend

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'tools'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/36

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 and usage tips.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors test code to eliminate duplication by introducing an AcceptanceTestSupport base class that consolidates common test setup, annotations, and mock beans. This allows for better context reuse across acceptance tests.

  • Introduced AcceptanceTestSupport abstract class with shared test configuration
  • Migrated all acceptance test classes to extend the new base class
  • Changed mock bean dependency from concrete FcmNotificationManager to FestivalNotificationManager interface

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated no comments.

File Description
AcceptanceTestSupport.java New abstract base class providing common test annotations, mock beans (Clock, FestivalNotificationManager, ShuffleManager), and RestAssured port setup
Multiple controller test files Removed duplicated annotations, setup methods, and mock bean declarations by extending AcceptanceTestSupport
FestabookApplicationTests.java Updated to extend AcceptanceTestSupport for context loading test

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@changuii changuii left a comment

Choose a reason for hiding this comment

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

LGTM

import org.springframework.context.annotation.Import;
import org.springframework.test.context.bean.override.mockito.MockitoBean;

@Import(TestSecurityConfig.class)
Copy link
Contributor

Choose a reason for hiding this comment

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

TestSecurityConfig는 테스트 용으로 따로 만든 security filter입니다.
테스트용 api 엔드포인트의 보안을 뚫어줍니다.

@changuii
Copy link
Contributor

FestivalNotificationManager 바꾼거 좋습니다.

@taek2222 taek2222 merged commit 3dce7e4 into dev Dec 22, 2025
5 checks passed
@taek2222 taek2222 deleted the refactor/36 branch December 22, 2025 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants