Skip to content

test: JaCoCo 테스트 설정 점검 및 커버리지 검증#97

Merged
jaehoon0321 merged 6 commits into
developfrom
dev/LJH
Apr 30, 2026
Merged

test: JaCoCo 테스트 설정 점검 및 커버리지 검증#97
jaehoon0321 merged 6 commits into
developfrom
dev/LJH

Conversation

@jaehoon0321
Copy link
Copy Markdown
Contributor

💡 PR 제목

test: JaCoCo 테스트 설정 점검 및 커버리지 검증 (70% 기준 충족)


🔗 관련 이슈

진행 중이면 Refs #123, 완전 해결이면 Closes #123 (완전히 끝났을 때만)

  • Refs/Closes: #

📌 작업 내용 요약

  • JaCoCo 플러그인 설정(v0.8.11) 및 제외 대상(Exclusions) 유효성 확인
  • JUnit 5 기반 전체 단위 테스트 수행 및 통과 확인
  • 라인 커버리지(LINE) 70% 최소 기준 충족 여부 검증 (jacocoTestCoverageVerification)
  • 로컬 환경 HTML 리포트 생성 확인

🧱 변경 범위 (Scope)
Backend

  • API 추가/수정
  • Validation/예외처리
  • 인증/인가
  • DB 스키마/쿼리
  • 기타: 테스트 인프라 점검 및 커버리지 검증

🧪 테스트 내역
Backend

  • 로컬에서 애플리케이션 실행 확인
  • 단위 테스트 통과
  • API 수동 테스트 (Postman / Swagger 등)

테스트 상세(필수)

  • 명령어: .\gradlew.bat clean test jacocoTestReport jacocoTestCoverageVerification
  • 결과: BUILD SUCCESSFUL
  • 검증 내용:
    • 전체 테스트 케이스 통과 확인
    • build.gradle에 정의된 70% 커버리지 임계값(Threshold) 통과 확인
    • dto, entity, config, security, exception 등 비즈니스 로직 외 패키지 제외 정상 작동 확인

⚠️ 영향도 / 리스크 / 롤백

  • 영향도: 기존 비즈니스 로직 및 API 응답에 영향 없음
  • 리스크: 없음 (순수 테스트 및 설정 검증 작업)
  • 롤백 방법: 해당 사항 없음

✅ 리뷰어 체크 포인트 (선택)

  • 현재 build.gradle에서 제외된 클래스들(DTO, Entity 등) 외에 추가로 측정이 필요하거나 제외해야 할 도메인이 있는지 확인 부탁드립니다.
  • 커버리지 기준(70%)을 향후 단계적으로 상향 조정할지 여부에 대한 의견 부탁드립니다.

Copy link
Copy Markdown
Contributor

@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

This pull request establishes a robust testing framework by integrating Jacoco for code coverage and transitioning the test environment to an H2 in-memory database. It introduces a standardized BaseControllerTest and implements extensive unit and integration tests across all major domains, including Address, AI, Auth, Menu, Order, and Payment. The review feedback suggests including the core AiService in coverage verification to ensure critical logic is tested and recommends using imports instead of fully qualified class names in test files to improve code readability.

Comment thread build.gradle
"**/entity/**",
"**/exception/**",
"**/handler/**",
"**/ai/service/AiService*"
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

AiService는 프로젝트의 핵심 기능인 AI 연동 로직을 담당하는 서비스입니다. 테스트 커버리지 검증 대상에서 제외할 경우, 핵심 비즈니스 로직의 테스트 누락을 파악하기 어려워집니다. 해당 제외 설정을 제거하여 커버리지 측정에 포함시키는 것을 권장합니다.

                    "**/handler/**"


// when & then
assertThatThrownBy(() -> menuService.createMenu(storeId, request, "hacker"))
.isInstanceOf(com.sparta.delivhub.common.dto.BusinessException.class);
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

클래스 참조 시 전체 패키지 경로(FQCN)를 사용하는 대신 import를 사용하고 클래스명만 사용하는 것이 가독성 측면에서 좋습니다.

Suggested change
.isInstanceOf(com.sparta.delivhub.common.dto.BusinessException.class);
.isInstanceOf(BusinessException.class);

Copy link
Copy Markdown
Contributor

@LeeSG-0114 LeeSG-0114 left a comment

Choose a reason for hiding this comment

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

lgtm

@jaehoon0321 jaehoon0321 linked an issue Apr 30, 2026 that may be closed by this pull request
2 tasks
@jaehoon0321 jaehoon0321 merged commit 1f0b47a into develop Apr 30, 2026
1 check 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.

[chore] JACOCO 테스트 커버리지 70%

2 participants