Skip to content

[REFACTOR] 사용하지 않는 api 제거#324

Merged
unifolio0 merged 2 commits intodevelopfrom
refactor/#323
Jan 21, 2026
Merged

[REFACTOR] 사용하지 않는 api 제거#324
unifolio0 merged 2 commits intodevelopfrom
refactor/#323

Conversation

@unifolio0
Copy link
Contributor

closed #323

작업 내용

스크린샷

참고 사항

@unifolio0 unifolio0 self-assigned this Jan 21, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 2026

Caution

Review failed

The pull request is closed.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Summary by CodeRabbit

릴리스 노트

Bug Fixes

  • 외부 API 예외 처리에서 상태 코드 접근 방식을 개선하여 오류 응답 처리 신뢰성 향상

Refactor

  • 인증 엔드포인트 통합: 공급사별 로그아웃/탈퇴를 일반화
  • 인터뷰 관련 API 및 진행/좋아요 흐름 간소화
  • 회원 랭킹 V3 제거 및 관련 인터페이스 정리
  • 내부 DTO 패키지 구조 재배치

Chores

  • 미사용 Kafka/Bedrock 연동 및 테스트 목업 등 불필요한 구성 요소 제거

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

미사용 API와 관련 인프라를 제거하고 일부 DTO를 resumebased 패키지로 이동하는 리팩터링입니다. Kakao 전용 로그아웃/탈퇴 엔드포인트, Kafka 프로듀서/프로듀서 사용 코드, Bedrock 클라이언트, 인터뷰 진행 관련 API/테스트 등이 삭제되었습니다.

Changes

코호트 / 파일(s) 변경 요약
인증 API 통합
api/src/main/java/com/samhap/kokomen/auth/controller/AuthController.java, api/src/main/java/com/samhap/kokomen/auth/service/AuthService.java
Kakao 전용 /kakao-logout, /kakao-withdraw 제거 및 범용 /logout, /withdraw로 교체; 서비스에서 제공자별 로그아웃 로직을 통합
Kafka 인프라 제거
api/src/main/java/com/samhap/kokomen/global/config/KafkaProducerConfig.java, api/src/main/java/com/samhap/kokomen/interview/service/InterviewLikeEventProducer.java, api/src/main/java/com/samhap/kokomen/interview/service/InterviewLikeEventProducerV2.java, api/src/test/java/.../BaseTest.java
Kafka ProducerConfig와 인터뷰 좋아요 이벤트 프로듀서 클래스들 및 테스트의 KafkaTemplate 목 객체 제거
Bedrock 및 인터뷰 진행 API 제거
api/src/main/java/com/samhap/kokomen/interview/external/BedrockClient.java, api/src/main/java/com/samhap/kokomen/interview/controller/InterviewController.java, api/src/main/java/com/samhap/kokomen/interview/service/InterviewFacadeService.java, api/src/test/java/.../InterviewControllerTest.java, api/src/test/java/.../InterviewDocsTest.java, api/src/test/java/.../InterviewControllerTest.java
BedrockClient 삭제, 인터뷰 진행(proceedInterview) 및 관련 테스트/문서/대체 like-Kafka 엔드포인트 제거
Resume 기반 DTO 패키지 이동
api/src/main/java/com/samhap/kokomen/interview/service/dto/resumebased/*, api/src/main/java/com/samhap/kokomen/interview/controller/ResumeBasedInterviewController.java, api/src/main/java/com/samhap/kokomen/interview/service/ResumeBasedInterviewService.java, api/src/main/java/com/samhap/kokomen/interview/service/QuestionGenerationAsyncService.java
Resume 관련 DTO들을 com.samhap.kokomen.interview.service.dto.resumebased로 패키지 이동 및 관련 import 업데이트
미사용 DTO/유틸 제거
api/src/main/java/com/samhap/kokomen/interview/service/dto/AnswerRequest.java, .../GeneratedQuestionResponse.java, .../InterviewLikeEventPayload.java
미사용 DTO 레코드 삭제
외부 클라이언트·빌더 소소 변경
api/src/main/java/com/samhap/kokomen/auth/external/*.java, api/src/main/java/com/samhap/kokomen/interview/external/SupertoneClient.java, .../PaymentClient.java, *ClientBuilder.java
람다 → 메서드 참조 변환 및 RestClientResponseException에서 getStatusCode() 사용으로 에러 핸들링 호출 변경(동일 동작)
순위 v3 API 제거
api/src/main/java/com/samhap/kokomen/member/controller/MemberController.java, api/src/main/java/com/samhap/kokomen/member/service/MemberService.java, common/src/main/java/com/samhap/kokomen/member/repository/MemberRepository.java
ranking v3 엔드포인트 및 서비스/레포지토리 관련 메서드 제거
상수/컨트롤러 소소 수정
api/src/main/java/com/samhap/kokomen/global/constant/AwsConstant.java, api/src/main/java/com/samhap/kokomen/token/controller/TokenController.java
AwsConstant를 final로 변경하고 private 생성자 추가, 불필요한 import 제거 등
테스트 정리 및 포맷팅
api/src/test/java/... (여러 파일, 20+개)
Bedrock/Kafka 관련 목 제거, 인터뷰 진행·로그아웃·탈퇴 관련 테스트 삭제, 픽스처 간소화 및 assertion 스타일(isZero 등) 통일, 포매팅 변경

Sequence Diagram(s)

(조건 불충족 — 변경은 주로 제거/리팩터링이며 새로운 다중 컴포넌트 제어 흐름 추가가 아니므로 다이어그램을 생략합니다.)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Possibly related PRs

Suggested reviewers

  • nak-honest
  • kargowild

Poem

🐰 오래된 코드 숲을 헤치며,
쓸모없는 가지들을 잘라냈죠.
Kafka와 Bedrock은 작별, DTO는 새 둥지로,
깔끔해진 길 따라 버그도 웃음 짓네. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.08% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 '[REFACTOR] 사용하지 않는 api 제거'로, 변경 사항의 핵심인 사용하지 않는 API 제거를 명확하게 설명하고 있습니다.
Description check ✅ Passed PR 설명은 이슈 #323 종료를 언급하고 있어 변경 사항과 관련이 있으며, 제목과 연관된 리팩토링 작업에 대한 최소한의 문맥을 제공합니다.
Linked Issues check ✅ Passed 연결된 이슈 #323은 동일한 제목으로 사용하지 않는 API 제거 작업을 나타내며, 커밋 메시지는 사용하지 않는 API, 클래스, 메소드, 필드 제거를 명시적으로 설명합니다. 변경 사항은 이 목표와 일치합니다.
Out of Scope Changes check ✅ Passed 모든 변경 사항이 사용하지 않는 엔티티 제거 목표에 부합합니다. 다만 일부 포맷팅 변경과 메소드 리팩토링이 주요 목표 외에 포함되어 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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

@gemini-code-assist
Copy link

Summary of Changes

Hello @unifolio0, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on a significant refactoring effort to clean up the codebase by eliminating unused API endpoints and their underlying service logic. It also removes integrations with Kafka and Bedrock, suggesting a simplification or evolution of the system's external dependencies. A major DTO package reorganization for resume-based interview features further enhances the project's structure and maintainability.

Highlights

  • Unused API Removal: Removed several API endpoints and their corresponding service methods, including Kakao logout/withdraw, a specific interview progression endpoint, and Kafka-based interview liking endpoints.
  • Kafka Integration Removal: The entire Kafka producer configuration and related event producers for interview likes have been removed, streamlining the messaging architecture.
  • Bedrock Client Deprecation: The Bedrock client implementation has been removed, indicating a shift away from or replacement of this external service.
  • DTO Package Refactoring: Numerous Data Transfer Objects (DTOs) related to resume-based interview features have been moved to a dedicated resumebased subpackage for improved code organization.
  • Minor Code Enhancements: Implemented minor refactorings such as using method references for removeIf predicates and standardizing exception handling for external API calls.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


Unused code, now gone, Kafka streams, no longer run, Cleaned up, new dawn.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

Test Results

 40 files   40 suites   58s ⏱️
228 tests 227 ✅ 1 💤 0 ❌
230 runs  229 ✅ 1 💤 0 ❌

Results for commit 581cd2f.

Copy link

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

Choose a reason for hiding this comment

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

Code Review

이 Pull Request는 사용하지 않는 API와 관련 코드를 제거하는 리팩토링을 주로 다루고 있습니다. Kafka 및 Bedrock 클라이언트 관련 로직, 특정 소셜 로그아웃/탈퇴 엔드포인트, 그리고 여러 컨트롤러의 미사용 API들이 성공적으로 제거되었습니다. 또한, DTO 패키지 구조 개선 및 코드 스타일 개선 등 전반적인 코드 품질 향상을 위한 변경 사항들이 포함되어 있습니다. 코드베이스에서 불필요한 부분을 덜어내어 유지보수성을 높이는 좋은 변경이라고 생각합니다. 몇 가지 추가 개선을 위한 제안 사항을 코멘트로 남겼습니다.

@@ -3,4 +3,7 @@
public abstract class AwsConstant {

Choose a reason for hiding this comment

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

medium

유틸리티 클래스는 인스턴스화와 상속을 막기 위해 abstract 대신 final로 선언하고 private 생성자를 두는 것이 일반적입니다. abstract 클래스는 상속을 허용하지만, private 생성자로 인해 자식 클래스에서 super()를 호출할 수 없어 사실상 상속이 무의미해집니다. 의도를 명확히 하기 위해 final로 변경하는 것을 권장합니다.

Suggested change
public abstract class AwsConstant {
public final class AwsConstant {

LocalDate yesterday = today.minusDays(1);
LocalDate twoDaysAgo = today.minusDays(2);
today.minusDays(2);

Choose a reason for hiding this comment

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

medium

today.minusDays(2); 구문은 아무런 효과가 없는 코드입니다. LocalDate는 불변 객체이므로 minusDays 메소드는 새로운 LocalDate 객체를 반환하며, 이 반환값을 사용하지 않으면 아무 일도 일어나지 않습니다. 사용되지 않는 변수 twoDaysAgo를 제거하는 과정에서 남은 것으로 보이며, 이 라인 전체를 삭제하는 것이 좋습니다.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
api/src/main/java/com/samhap/kokomen/auth/service/AuthService.java (1)

66-75: 동일한 쿼리를 두 번 호출하고 있습니다.

memberSocialLoginRepository.findByMember_Id(member.getId())가 KAKAO용과 GOOGLE용으로 각각 한 번씩 호출됩니다. logout() 메서드(Line 85-91)처럼 한 번의 쿼리로 처리할 수 있습니다.

♻️ 개선 제안
     `@Transactional`
     public void withdraw(MemberAuth memberAuth) {
         Member member = memberService.readById(memberAuth.memberId());
 
-        // 카카오 소셜로그인 정보 조회하여 카카오 연동해제
-        memberSocialLoginRepository.findByMember_Id(member.getId()).stream()
-                .filter(socialLogin -> socialLogin.getProvider() == SocialProvider.KAKAO)
-                .findFirst()
-                .ifPresent(kakaoLogin -> kakaoOAuthClient.unlinkKakaoUser(Long.valueOf(kakaoLogin.getSocialId())));
-
-        // 구글 소셜로그인 정보 조회하여 구글 연동해제
-        memberSocialLoginRepository.findByMember_Id(member.getId()).stream()
-                .filter(socialLogin -> socialLogin.getProvider() == SocialProvider.GOOGLE)
-                .findFirst()
-                .ifPresent(googleLogin -> googleOAuthClient.revokeGoogleToken(googleLogin.getSocialId()));
+        // 모든 소셜로그인 제공자에 대해 연동해제 처리
+        memberSocialLoginRepository.findByMember_Id(member.getId()).forEach(socialLogin -> {
+            if (socialLogin.getProvider() == SocialProvider.KAKAO) {
+                kakaoOAuthClient.unlinkKakaoUser(Long.valueOf(socialLogin.getSocialId()));
+            } else if (socialLogin.getProvider() == SocialProvider.GOOGLE) {
+                googleOAuthClient.revokeGoogleToken(socialLogin.getSocialId());
+            }
+        });
 
         memberService.withdraw(member);
     }
api/src/test/java/com/samhap/kokomen/interview/controller/InterviewControllerV2Test.java (1)

253-253: REST Docs 문서 식별자 불일치

이 테스트는 TTS_PENDING 상태를 테스트하지만, 문서 식별자가 "interview-getPolling-LLM-PENDING-V2"로 되어 있습니다. "interview-getPolling-TTS-PENDING-V2"로 수정해야 합니다.

동일한 문제가 304번 라인의 TTS_FAILED 테스트에도 있습니다 ("interview-getPolling-LLM-FAILED-V2""interview-getPolling-TTS-FAILED-V2").

🐛 문서 식별자 수정 제안

Line 253:

-                .andDo(document("interview-getPolling-LLM-PENDING-V2",
+                .andDo(document("interview-getPolling-TTS-PENDING-V2",

Line 304:

-                .andDo(document("interview-getPolling-LLM-FAILED-V2",
+                .andDo(document("interview-getPolling-TTS-FAILED-V2",
api/src/test/java/com/samhap/kokomen/interview/repository/InterviewRepositoryTest.java (1)

78-115: Line 86의 no-op 호출 제거 필요

today.minusDays(2);는 반환값을 사용하지 않아 테스트 의도가 불명확합니다. 필요 없다면 제거하고, 필요하면 변수로 저장해 사용하세요.

🧹 제안 수정
-        today.minusDays(2);
🤖 Fix all issues with AI agents
In `@api/src/main/java/com/samhap/kokomen/global/constant/AwsConstant.java`:
- Around line 3-8: The AwsConstant class is incorrectly declared abstract while
also having a private constructor; change it to follow the static-utility
pattern by making the class final (class AwsConstant -> final class AwsConstant)
and keeping the private constructor, or better yet remove this duplicate class
entirely and reference the existing AwsConstant in the common module (ensure api
depends on common and uses common.AwsConstant.CLOUD_FRONT_DOMAIN_URL) so there’s
a single source of truth for CLOUD_FRONT_DOMAIN_URL.

In
`@api/src/test/java/com/samhap/kokomen/answer/controller/AnswerControllerTest.java`:
- Around line 211-213: In AnswerControllerTest update the AssertJ assertions for
consistency: replace any uses of isEqualTo(1) with the idiomatic isOne() (e.g.,
the assertion around the like-count check in the test method that currently uses
isEqualTo(1)) and keep the existing isZero() used for the zero check; locate
these assertions inside the test method(s) in the AnswerControllerTest class
(the blocks referencing answerRepository.findById(...).get().getLikeCount() and
answerLikeRepository.existsByMemberIdAndAnswerId(...)) and change the numeric
equality assertions to isOne()/isZero() accordingly.

In
`@api/src/test/java/com/samhap/kokomen/interview/controller/InterviewControllerV2Test.java`:
- Around line 449-452: Remove the leftover debug print by deleting the
System.out.println(...) call that prints
questionRepository.findTop2ByInterviewIdOrderByIdDesc(interview.getId()); keep
the QuestionFixtureBuilder save as-is; this means removing the
System.out.println statement referencing findTop2ByInterviewIdOrderByIdDesc and
interview.getId() so no debug output remains in InterviewControllerV2Test.
- Around line 385-388: Remove the leftover debug print in the test: delete the
System.out.println(...) call in InterviewControllerV2Test (the call that prints
questionRepository.findTop2ByInterviewIdOrderByIdDesc(interview.getId())).
Ensure no other System.out or similar debug logging remains in the test method
after you removed the unused question3 assignment, so test runs produce no
extraneous console output.

In
`@api/src/test/java/com/samhap/kokomen/member/repository/MemberRepositoryTest.java`:
- Around line 31-33: The three saved members in MemberRepositoryTest are created
with MemberFixtureBuilder but no explicit nicknames, which can mask intent and
break future unique constraints; update the three save calls to supply distinct
nicknames via MemberFixtureBuilder.nickname(...) (e.g., "ranker1", "ranker2",
"ranker3"), ensuring the second saved instance assigned to Member ranker2 also
receives a unique nickname so the test behavior and future uniqueness
constraints remain clear and robust.
♻️ Duplicate comments (3)
api/src/test/java/com/samhap/kokomen/interview/service/InterviewViewCountServiceTest.java (3)

88-89: 동일 이슈 반복: 기본 빌더로 동일 데이터 저장

Line 50-51 코멘트와 동일한 우려가 적용됩니다(기본값 중복에 따른 제약/로직 충돌 가능성).


127-128: 동일 이슈 반복: 기본 빌더로 동일 데이터 저장

Line 50-51 코멘트와 동일한 우려가 적용됩니다(기본값 중복에 따른 제약/로직 충돌 가능성).


211-212: 동일 이슈 반복: 기본 빌더로 동일 데이터 저장

Line 50-51 코멘트와 동일한 우려가 적용됩니다(기본값 중복에 따른 제약/로직 충돌 가능성).

Comment on lines 3 to 8
public abstract class AwsConstant {

public static final String CLOUD_FRONT_DOMAIN_URL = "https://dhtg8wzvkbfxr.cloudfront.net/";

private AwsConstant() {
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for all AwsConstant.java files in the repository
echo "=== Searching for AwsConstant.java files ==="
fd -t f "AwsConstant.java"

Repository: samhap-soft/kokomen-backend

Length of output: 258


🏁 Script executed:

#!/bin/bash
# Get file contents of all AwsConstant files found
echo "=== Contents of AwsConstant.java files ==="
for file in $(fd -t f "AwsConstant.java"); do
  echo "File: $file"
  echo "---"
  cat -n "$file"
  echo ""
done

Repository: samhap-soft/kokomen-backend

Length of output: 780


🏁 Script executed:

#!/bin/bash
# Verify the repository structure to understand modules
echo "=== Repository structure ==="
git ls-files | head -30

Repository: samhap-soft/kokomen-backend

Length of output: 1266


🏁 Script executed:

#!/bin/bash
# Search for imports of AwsConstant to understand usage
echo "=== Imports of AwsConstant ==="
rg "import.*AwsConstant" --type java

echo ""
echo "=== Direct usage of AwsConstant (not imports) ==="
rg "AwsConstant\." --type java | head -20

echo ""
echo "=== Check for subclasses of AwsConstant ==="
rg "extends AwsConstant" --type java

Repository: samhap-soft/kokomen-backend

Length of output: 2252


🏁 Script executed:

#!/bin/bash
# Check if common module is a dependency of api module
echo "=== Build configuration files ==="
find . -name "build.gradle" -o -name "pom.xml" | grep -E "(api|common)" | xargs ls -la

echo ""
echo "=== Check api's build.gradle for common dependency ==="
if [ -f "api/build.gradle" ]; then
  echo "Looking for common module dependency..."
  grep -i "common" api/build.gradle || echo "No common dependency found"
fi

echo ""
echo "=== Check common's build.gradle ==="
if [ -f "common/build.gradle" ]; then
  echo "common/build.gradle exists"
  head -30 common/build.gradle
fi

Repository: samhap-soft/kokomen-backend

Length of output: 1257


abstractprivate 생성자의 조합이 모순입니다.

abstract 클래스는 이미 직접 인스턴스화가 불가능합니다. private 생성자를 추가하면 서브클래싱이 차단되어 abstract의 의미가 사라집니다. 정적 상수만 포함하는 유틸리티 클래스의 경우, Java 표준 패턴은 final classprivate 생성자 조합입니다.

♻️ 권장 수정안
-public abstract class AwsConstant {
+public final class AwsConstant {

     public static final String CLOUD_FRONT_DOMAIN_URL = "https://dhtg8wzvkbfxr.cloudfront.net/";

     private AwsConstant() {
     }
 }

추가로, common 모듈에도 동일한 AwsConstant 클래스가 존재합니다. api 모듈이 이미 common에 의존하고 있으므로, 중복을 제거하고 common 모듈의 버전을 통합하여 사용하는 것을 권장합니다. 현재 두 버전의 구현이 일치하지 않아 유지보수상 문제가 될 수 있습니다.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public abstract class AwsConstant {
public static final String CLOUD_FRONT_DOMAIN_URL = "https://dhtg8wzvkbfxr.cloudfront.net/";
private AwsConstant() {
}
public final class AwsConstant {
public static final String CLOUD_FRONT_DOMAIN_URL = "https://dhtg8wzvkbfxr.cloudfront.net/";
private AwsConstant() {
}
🤖 Prompt for AI Agents
In `@api/src/main/java/com/samhap/kokomen/global/constant/AwsConstant.java` around
lines 3 - 8, The AwsConstant class is incorrectly declared abstract while also
having a private constructor; change it to follow the static-utility pattern by
making the class final (class AwsConstant -> final class AwsConstant) and
keeping the private constructor, or better yet remove this duplicate class
entirely and reference the existing AwsConstant in the common module (ensure api
depends on common and uses common.AwsConstant.CLOUD_FRONT_DOMAIN_URL) so there’s
a single source of truth for CLOUD_FRONT_DOMAIN_URL.

Comment on lines +211 to +213
() -> assertThat(
answerLikeRepository.existsByMemberIdAndAnswerId(member.getId(), answer.getId())).isFalse(),
() -> assertThat(answerRepository.findById(answer.getId()).get().getLikeCount()).isZero()
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

LGTM! AssertJ 관용적 표현 사용 개선

isEqualTo(0) 대신 isZero()를 사용한 것은 AssertJ의 관용적 표현으로, 테스트 의도가 더 명확하게 전달됩니다. 라인 90의 isEqualTo(1) 체크도 동일하게 isOne()으로 변경하면 일관성이 높아질 수 있습니다.

♻️ 선택적 개선 제안
-                () -> assertThat(answerRepository.findById(answer.getId()).get().getLikeCount()).isEqualTo(1)
+                () -> assertThat(answerRepository.findById(answer.getId()).get().getLikeCount()).isOne()
🤖 Prompt for AI Agents
In
`@api/src/test/java/com/samhap/kokomen/answer/controller/AnswerControllerTest.java`
around lines 211 - 213, In AnswerControllerTest update the AssertJ assertions
for consistency: replace any uses of isEqualTo(1) with the idiomatic isOne()
(e.g., the assertion around the like-count check in the test method that
currently uses isEqualTo(1)) and keep the existing isZero() used for the zero
check; locate these assertions inside the test method(s) in the
AnswerControllerTest class (the blocks referencing
answerRepository.findById(...).get().getLikeCount() and
answerLikeRepository.existsByMemberIdAndAnswerId(...)) and change the numeric
equality assertions to isOne()/isZero() accordingly.

Comment on lines 385 to 388
questionRepository.save(
QuestionFixtureBuilder.builder().interview(interview).content("오상훈의 위 부피를 계산해주세요.").build());

System.out.println(questionRepository.findTop2ByInterviewIdOrderByIdDesc(interview.getId()));
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

사용하지 않는 변수 제거 - LGTM!

question3 변수가 사용되지 않아 할당을 제거한 것은 적절합니다.

단, 388번 라인의 System.out.println 디버그 문도 함께 제거하는 것을 권장합니다. 테스트 코드에 디버그 출력이 남아있으면 테스트 실행 시 불필요한 로그가 출력됩니다.

🧹 디버그 문 제거 제안
         questionRepository.save(
                 QuestionFixtureBuilder.builder().interview(interview).content("오상훈의 위 부피를 계산해주세요.").build());

-        System.out.println(questionRepository.findTop2ByInterviewIdOrderByIdDesc(interview.getId()));
-
         String interviewProceedStateKey = InterviewFacadeService.createInterviewProceedStateKey(interview.getId(),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
questionRepository.save(
QuestionFixtureBuilder.builder().interview(interview).content("오상훈의 위 부피를 계산해주세요.").build());
System.out.println(questionRepository.findTop2ByInterviewIdOrderByIdDesc(interview.getId()));
questionRepository.save(
QuestionFixtureBuilder.builder().interview(interview).content("오상훈의 위 부피를 계산해주세요.").build());
🤖 Prompt for AI Agents
In
`@api/src/test/java/com/samhap/kokomen/interview/controller/InterviewControllerV2Test.java`
around lines 385 - 388, Remove the leftover debug print in the test: delete the
System.out.println(...) call in InterviewControllerV2Test (the call that prints
questionRepository.findTop2ByInterviewIdOrderByIdDesc(interview.getId())).
Ensure no other System.out or similar debug logging remains in the test method
after you removed the unused question3 assignment, so test runs produce no
extraneous console output.

Comment on lines 449 to 452
questionRepository.save(
QuestionFixtureBuilder.builder().interview(interview).content("오상훈의 위 부피를 계산해주세요.").build());

System.out.println(questionRepository.findTop2ByInterviewIdOrderByIdDesc(interview.getId()));
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

사용하지 않는 변수 제거 - LGTM!

위와 동일하게 사용하지 않는 변수 할당 제거는 적절합니다.

452번 라인의 System.out.println 디버그 문도 함께 정리해주세요.

🧹 디버그 문 제거 제안
         questionRepository.save(
                 QuestionFixtureBuilder.builder().interview(interview).content("오상훈의 위 부피를 계산해주세요.").build());

-        System.out.println(questionRepository.findTop2ByInterviewIdOrderByIdDesc(interview.getId()));
-
         String interviewProceedStateKey = InterviewFacadeService.createInterviewProceedStateKey(interview.getId(),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
questionRepository.save(
QuestionFixtureBuilder.builder().interview(interview).content("오상훈의 위 부피를 계산해주세요.").build());
System.out.println(questionRepository.findTop2ByInterviewIdOrderByIdDesc(interview.getId()));
questionRepository.save(
QuestionFixtureBuilder.builder().interview(interview).content("오상훈의 위 부피를 계산해주세요.").build());
🤖 Prompt for AI Agents
In
`@api/src/test/java/com/samhap/kokomen/interview/controller/InterviewControllerV2Test.java`
around lines 449 - 452, Remove the leftover debug print by deleting the
System.out.println(...) call that prints
questionRepository.findTop2ByInterviewIdOrderByIdDesc(interview.getId()); keep
the QuestionFixtureBuilder save as-is; this means removing the
System.out.println statement referencing findTop2ByInterviewIdOrderByIdDesc and
interview.getId() so no debug output remains in InterviewControllerV2Test.

Comment on lines +31 to +33
memberRepository.save(MemberFixtureBuilder.builder().score(100).build());
Member ranker2 = memberRepository.save(MemberFixtureBuilder.builder().score(50).build());
memberRepository.save(MemberFixtureBuilder.builder().score(0).build());
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# 먼저 Member 엔티티 파일 찾기
find . -name "Member.java" -o -name "Member.kt" | grep -v test | head -20

Repository: samhap-soft/kokomen-backend

Length of output: 138


🏁 Script executed:

# MemberFixtureBuilder 찾기
find . -name "*MemberFixtureBuilder*" -type f | head -20

Repository: samhap-soft/kokomen-backend

Length of output: 157


🏁 Script executed:

# 테스트 파일 확인
find . -path "*member/repository/MemberRepositoryTest.java"

Repository: samhap-soft/kokomen-backend

Length of output: 153


🏁 Script executed:

cat -n ./common/src/main/java/com/samhap/kokomen/member/domain/Member.java

Repository: samhap-soft/kokomen-backend

Length of output: 2232


🏁 Script executed:

cat -n ./api/src/test/java/com/samhap/kokomen/global/fixture/member/MemberFixtureBuilder.java

Repository: samhap-soft/kokomen-backend

Length of output: 1284


🏁 Script executed:

cat -n ./api/src/test/java/com/samhap/kokomen/member/repository/MemberRepositoryTest.java

Repository: samhap-soft/kokomen-backend

Length of output: 4095


테스트 의도를 명확하게 하기 위해 고유 닉네임 지정 권장

현재 코드베이스의 Member 엔티티에는 nickname 필드에 unique constraint가 없으므로, 동일한 닉네임으로 저장해도 즉시 문제가 발생하지 않습니다. 그러나 다른 테스트 메서드(line 46-49)와의 일관성을 위해, 그리고 향후 unique constraint 추가 시 대비하기 위해 각 회원의 고유 닉네임을 명시하는 것이 좋습니다.

수정 제안
-        memberRepository.save(MemberFixtureBuilder.builder().score(100).build());
-        Member ranker2 = memberRepository.save(MemberFixtureBuilder.builder().score(50).build());
-        memberRepository.save(MemberFixtureBuilder.builder().score(0).build());
+        memberRepository.save(MemberFixtureBuilder.builder().nickname("100점 회원").score(100).build());
+        Member ranker2 = memberRepository.save(MemberFixtureBuilder.builder().nickname("50점 회원").score(50).build());
+        memberRepository.save(MemberFixtureBuilder.builder().nickname("0점 회원").score(0).build());
🤖 Prompt for AI Agents
In
`@api/src/test/java/com/samhap/kokomen/member/repository/MemberRepositoryTest.java`
around lines 31 - 33, The three saved members in MemberRepositoryTest are
created with MemberFixtureBuilder but no explicit nicknames, which can mask
intent and break future unique constraints; update the three save calls to
supply distinct nicknames via MemberFixtureBuilder.nickname(...) (e.g.,
"ranker1", "ranker2", "ranker3"), ensuring the second saved instance assigned to
Member ranker2 also receives a unique nickname so the test behavior and future
uniqueness constraints remain clear and robust.

@unifolio0 unifolio0 merged commit cebb67b into develop Jan 21, 2026
2 of 3 checks passed
@unifolio0 unifolio0 deleted the refactor/#323 branch January 21, 2026 07:24
@coderabbitai coderabbitai bot mentioned this pull request Feb 24, 2026
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.

[REFACTOR] 사용하지 않는 api 제거

1 participant