Skip to content

Comments

[FEAT] 모임 V2 테스트 리팩토링 #139

Merged
LimdaeIl merged 2 commits intomainfrom
feat/test
Dec 19, 2025
Merged

[FEAT] 모임 V2 테스트 리팩토링 #139
LimdaeIl merged 2 commits intomainfrom
feat/test

Conversation

@LimdaeIl
Copy link
Collaborator

@LimdaeIl LimdaeIl commented Dec 19, 2025

📝 Pull Request

📌 PR 종류

해당하는 항목에 체크해주세요.

  • 기능 추가 (Feature)
  • 버그 수정 (Fix)
  • 문서 수정 (Docs)
  • 코드 리팩터링 (Refactor)
  • 테스트 추가 (Test)
  • 기타 변경 (Chore)

✨ 변경 내용

[FEAT] 모임 V2 테스트 리팩토링
이미지 업로드 엔드포인트가 멀티파트 폼 데이터를 허용하도록 구성하여 이미지 파일 전송이 가능하도록 합니다.
그룹 v2 HTTP 테스트를 리팩토링하여 일관된 명명 규칙과 구조를 적용했습니다.

참석, 취소, 목록 조회, 가져오기, 업데이트 작업에 대한 테스트 케이스를 업데이트했습니다.

취소 및 목록 조회 테스트에서 그룹 생성 및 관리에 HOST2를 사용합니다.

가져오기 테스트에 과거 날짜로 그룹을 생성하는 테스트 케이스를 추가했습니다.

이미지 업로드 엔드포인트를 v2로 업데이트했습니다.

🔍 관련 이슈

🧪 테스트

변경된 기능에 대한 테스트 범위 또는 테스트 결과를 작성해주세요.

  • 유닛 테스트 추가 / 수정
  • 통합 테스트 검증
  • 수동 테스트 완료

🚨 확인해야 할 사항 (Checklist)

PR을 제출하기 전에 아래 항목들을 확인해주세요.

  • 코드 포매팅 완료
  • 불필요한 파일/코드 제거
  • 로직 검증 완료
  • 프로젝트 빌드 성공
  • 린트/정적 분석 통과 (해당 시)

🙋 기타 참고 사항

리뷰어가 참고하면 좋을 만한 추가 설명이 있다면 적어주세요.

Summary by CodeRabbit

릴리스 노트

  • Refactor

    • 내부 API 접근자 메서드 업데이트로 코드 구조 개선
    • 멀티파트 폼 데이터 콘텐츠 타입 명시적 선언 추가
  • Chores

    • 테스트 케이스 재구성 및 테스트 데이터 정리
    • V2 엔드포인트 기반 테스트 시나리오 통합

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

이미지 업로드 엔드포인트가 멀티파트 폼 데이터를 허용하도록 구성하여 이미지 파일 전송이 가능하도록 합니다.
또한, width() 및 height() 함수를 사용하여 이미지의 너비와 높이를 가져옵니다.
그룹 v2 HTTP 테스트를 리팩토링하여 일관된 명명 규칙과 구조를 적용했습니다.

참석, 취소, 목록 조회, 가져오기, 업데이트 작업에 대한 테스트 케이스를 업데이트했습니다.

취소 및 목록 조회 테스트에서 그룹 생성 및 관리에 HOST2를 사용합니다.

가져오기 테스트에 과거 날짜로 그룹을 생성하는 테스트 케이스를 추가했습니다.

이미지 업로드 엔드포인트를 v2로 업데이트했습니다.
@LimdaeIl LimdaeIl self-assigned this Dec 19, 2025
Copilot AI review requested due to automatic review settings December 19, 2025 07:58
@LimdaeIl LimdaeIl added the ✨enhancement New feature or request label Dec 19, 2025
@LimdaeIl LimdaeIl moved this from Backlog to In progress in WeGo-Together Backend Dec 19, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 19, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Group V2 테스트 코드를 리팩토링하여 V2 엔드포인트로 통합하고, 이미지 차원 접근자를 getter 메서드에서 속성 메서드로 업데이트합니다. 컨트롤러 엔드포인트에 명시적 멀티파트 콘텐츠 타입 지정을 추가합니다.

Changes

Cohort / File(s) Summary
Java 소스 코드 업데이트
src/main/java/team/wego/wegobackend/group/v2/application/dto/common/GroupImageVariantItem.java, src/main/java/team/wego/wegobackend/group/v2/presentation/GroupImageV2Controller.java
GroupImageV2VariantType의 차원 접근자를 getWidth()/getHeight()에서 width()/height()로 업데이트합니다. GroupImageV2Controller의 업로드 엔드포인트에 consumes = MediaType.MULTIPART_FORM_DATA_VALUE 속성을 추가합니다.
Redis 구성 정리
src/main/java/team/wego/wegobackend/group/v2/infrastructure/redis/PreUploadedGroupImageRedisConfig.java
파일 끝에 줄바꿈을 추가합니다.
V2 테스트 시나리오 리팩토링
src/test/http/group/v2/V2-group-cancel.http, src/test/http/group/v2/v2-group-attend.http, src/test/http/group/v2/v2-group-get-list.http, src/test/http/group/v2/v2-group-get.http, src/test/http/group/v2/v2-group-update.http
엔드포인트를 V1에서 V2로 마이그레이션하고, 인증 토큰을 HOST2 기반으로 업데이트합니다. 테스트 케이스를 다중 멤버 관점에서 재구성하고, 기준일(2026-12-20)을 기준으로 시간대를 조정합니다. 이미지 참조를 imgN_*에서 c_imgN_*로 변경하고, 페이지네이션 및 필터링 시나리오를 추가합니다.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • 주의 필요 영역:
    • v2-group-get-list.http: 광범위한 재구성 및 페이지네이션 로직 추가 — 테스트 흐름 일관성 확인 필요
    • v2-group-attend.http: 멀티 멤버 시나리오 및 토큰 변수 업데이트 — 모든 인증 헤더가 올바르게 적용되었는지 검증 필요
    • V2-group-cancel.http: 호스트 제약 조건 및 참여 상태 테스트 로직 — 예상된 예외 케이스가 정확히 반영되었는지 확인 필요

Possibly related PRs

Poem

🐰 테스트를 V2로 갈아입히고
🖼️ 이미지 접근자도 세련되게
📋 멀티파트로 선언하니
✨ 리팩토링의 정수를 맛보네!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/test

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 84be549 and 990b15e.

📒 Files selected for processing (8)
  • src/main/java/team/wego/wegobackend/group/v2/application/dto/common/GroupImageVariantItem.java (1 hunks)
  • src/main/java/team/wego/wegobackend/group/v2/infrastructure/redis/PreUploadedGroupImageRedisConfig.java (1 hunks)
  • src/main/java/team/wego/wegobackend/group/v2/presentation/GroupImageV2Controller.java (2 hunks)
  • src/test/http/group/v2/V2-group-cancel.http (10 hunks)
  • src/test/http/group/v2/v2-group-attend.http (2 hunks)
  • src/test/http/group/v2/v2-group-get-list.http (13 hunks)
  • src/test/http/group/v2/v2-group-get.http (5 hunks)
  • src/test/http/group/v2/v2-group-update.http (1 hunks)

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.

@LimdaeIl LimdaeIl merged commit bc91638 into main Dec 19, 2025
4 of 5 checks passed
@LimdaeIl LimdaeIl deleted the feat/test branch December 19, 2025 07:58
@github-project-automation github-project-automation bot moved this from In progress to Done in WeGo-Together Backend Dec 19, 2025
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 the Group V2 HTTP test suite to improve consistency and maintainability. The main focus is on standardizing test naming conventions, updating test data with valid future dates, and ensuring the image upload endpoint properly accepts multipart form data.

Key changes:

  • Updated image upload endpoint to explicitly declare consumes = MediaType.MULTIPART_FORM_DATA_VALUE for proper multipart handling
  • Standardized test case numbering and improved Korean comment clarity across all test files
  • Updated test dates from 2026-12-10/11 to 2026-12-20 to ensure tests use dates after the reference date (2026-12-19)

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
v2-group-update.http Corrected image filename extension from .jpeg to .jpg for consistency
v2-group-get.http Added test case for past date validation, updated test numbering and dates
v2-group-get-list.http Updated image upload endpoint from v1 to v2, improved test naming consistency
v2-group-attend.http Restructured attend/cancel test flow with consistent variable naming using c_ prefix
V2-group-cancel.http Standardized test numbering and comments, updated dates to post-reference date
GroupImageV2Controller.java Added explicit multipart form data consumption declaration to upload endpoint
PreUploadedGroupImageRedisConfig.java Added trailing newline for code style compliance
GroupImageVariantItem.java Changed from Lombok-generated getters to explicit width()/height() methods

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

"자바"
],
"description": "MEMBER들이 참석/중복 참석 예외를 테스트하기 위한 모임입니다.",
"description": "참여 취소/중복 취소/HOST 취소 예외를 테스트하는 모임입니다.",
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

Incomplete test description: The description mentions "참여 취소/중복 취소/HOST 취소 예외를 테스트하는 모임입니다" (testing cancellation scenarios), but this group is also used to test basic attend functionality (test cases 4-1 and 4-2). The description should include that this group tests both successful attendance and subsequent cancellation scenarios.

Suggested change
"description": "참여 취소/중복 취소/HOST 취소 예외를 테스트하는 모임입니다.",
"description": "기본 참석 성공 케이스와 이후 참여 취소/중복 취소/HOST 취소 예외를 함께 테스트하는 모임입니다.",

Copilot uses AI. Check for mistakes.
Comment on lines +21 to +22
type.width(),
type.height(),
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

Inconsistent method usage for accessing width and height. While this file now uses type.width() and type.height(), the similar file GroupImageItem.java still uses getWidth() and getHeight() for the same enum type. Since the enum GroupImageV2VariantType provides both getter methods (via Lombok @Getter) and explicit methods, the codebase should consistently use one approach. Consider either using the Lombok-generated getters everywhere or the explicit methods everywhere for consistency.

Suggested change
type.width(),
type.height(),
type.getWidth(),
type.getHeight(),

Copilot uses AI. Check for mistakes.
@@ -1,4 +1,4 @@
### 회원가입(HOST)
### 0. 회원가입(HOST2)
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

Inconsistent filename casing: This file is named V2-group-cancel.http with an uppercase 'V', while all other test files in the same directory use lowercase (e.g., v2-group-attend.http, v2-group-get.http, v2-group-update.http). For consistency with the other test files in this refactoring, consider renaming this file to v2-group-cancel.http.

Copilot uses AI. Check for mistakes.


@PostMapping("/upload")
@PostMapping(value="/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

Inconsistent spacing around equals signs in annotation parameters. The value="/upload" has no spaces around =, while consumes = MediaType.MULTIPART_FORM_DATA_VALUE has spaces around =. For consistency, consider using the same spacing style for both parameters (either value = "/upload" or removing spaces from the consumes parameter).

Suggested change
@PostMapping(value="/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)

Copilot uses AI. Check for mistakes.

### 2-2. V2 모임 생성 (업로드된 URL로 생성)

### 1-2. 모임 V2 생성 (취소 테스트용 모임 / 정상 케이스: 기준일 2026-12-19 이후 날짜)
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

Misleading test description: The comment says "취소 테스트용 모임" (for cancel testing) and line 74 mentions only cancellation scenarios, but this file actually tests both attend functionality (test cases 4-1, 4-2 at lines 155-168) and cancellation functionality (test cases 5-1, 5-2, 5-3 at lines 171-192). The description should reflect that this group is used for testing both attend and cancel operations, not just cancellation.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[FEAT] 모임 V2 테스트 리팩토링

1 participant