Skip to content

Feature/#54 이미지 관련 api의 rest docs 작성#68

Merged
sjmoon00 merged 6 commits intodevelopfrom
Feature/#54-이미지_관련_API의_RestDocs_작성
Feb 4, 2026

Hidden character warning

The head ref may contain hidden characters: "Feature/#54-\uc774\ubbf8\uc9c0_\uad00\ub828_API\uc758_RestDocs_\uc791\uc131"
Merged

Feature/#54 이미지 관련 api의 rest docs 작성#68
sjmoon00 merged 6 commits intodevelopfrom
Feature/#54-이미지_관련_API의_RestDocs_작성

Conversation

@sjmoon00
Copy link
Contributor

🔥 연관된 이슈

close: #54

📜 작업 내용

  • 이전에 구현했던 이미지 관련 api의 rest docs작성

💬 리뷰 요구사항

  • 특별히 없습니다

✨ 기타

  • 벌써 1월이 끝나가네요

@sjmoon00 sjmoon00 requested review from JJimini, Copilot, myeowon and pykido and removed request for Copilot and pykido January 29, 2026 11:43
@sjmoon00 sjmoon00 self-assigned this Jan 29, 2026
@sjmoon00 sjmoon00 added the 🕐 간단 수정 수정 코드 100줄 이하의 간단한 수정 label Jan 29, 2026
Copy link
Collaborator

@JJimini JJimini left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~~

Copy link
Contributor

@pykido pykido left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~!!!

Copilot AI review requested due to automatic review settings February 4, 2026 06:02
@sjmoon00 sjmoon00 merged commit cda6647 into develop Feb 4, 2026
4 checks passed
@sjmoon00 sjmoon00 deleted the Feature/#54-이미지_관련_API의_RestDocs_작성 branch February 4, 2026 06:02
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 pull request adds REST API documentation for image-related endpoints that were previously implemented but lacked documentation. The PR addresses issue #54 by documenting team thumbnail, team preview, and contest banner image APIs.

Changes:

  • Added comprehensive REST Docs tests for team image operations (poster, thumbnail, preview)
  • Added REST Docs tests for contest banner image operations
  • Updated AsciiDoc documentation to include the new image API endpoints with success and failure cases

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
TeamApiDocsTest.java Added REST Docs test methods for team thumbnail retrieval, upload, deletion; team preview retrieval, upload, deletion with failure cases; refactored authorization header descriptions
ContestApiDocsTest.java Added REST Docs test methods for contest banner retrieval, upload, deletion with failure cases; refactored authorization header descriptions
team.adoc Added documentation sections for team thumbnail and preview image endpoints with collapsible failure case examples
contest.adoc Added documentation section for contest banner image endpoints with collapsible failure case examples; fixed link path from ../opus.html to ./opus.html

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

Comment on lines +68 to +89
@Test
@DisplayName("[실패] 존재하지 않는 팀의 포스터 이미지를 조회하면 실패한다.")
void 팀의_포스터_이미지_조회_실패_팀없음() throws Exception {
// Given
final Long teamId = 999L;

when(teamQueryService.getPosterImage(any()))
.thenThrow(new FileException(FileExceptionType.NOT_EXISTS_MATCHING_IMAGE_ID)); // Assuming logic or specific TeamException. checking service...
// Wait, service uses teamConvenience.validateExistTeam(teamId).
// I need to mock the service call to throw the exception that represents "Team Not Found" or "Image Not Found".
// In TeamQueryService.getImage:
// 1. teamConvenience.validateExistTeam -> TeamException
// 2. fileConvenience.find... -> FileException(NOT_EXISTS_MATCHING_IMAGE_ID)
// I will use NOT_EXISTS_MATCHING_IMAGE_ID for "Image Not Found" case.
// For "Team Not Found", I should use a TeamException, but I don't have TeamException import yet?
// Let's stick to FileException cases as requested "failed cases for poster/thumbnail" usually implies file absence.
// But the prompt asked for "failure cases".
// I'll stick to FileException for consistency with previous file tests.
}

// RE-WRITING THE REPLACEMENT TO BE CORRECT

Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

This entire test method (lines 68-88) contains only comments and no actual test execution code. It appears to be a draft or leftover code that should be removed. The actual working test implementation exists below at lines 90-107.

Suggested change
@Test
@DisplayName("[실패] 존재하지 않는 팀의 포스터 이미지를 조회하면 실패한다.")
void 팀의_포스터_이미지_조회_실패_팀없음() throws Exception {
// Given
final Long teamId = 999L;
when(teamQueryService.getPosterImage(any()))
.thenThrow(new FileException(FileExceptionType.NOT_EXISTS_MATCHING_IMAGE_ID)); // Assuming logic or specific TeamException. checking service...
// Wait, service uses teamConvenience.validateExistTeam(teamId).
// I need to mock the service call to throw the exception that represents "Team Not Found" or "Image Not Found".
// In TeamQueryService.getImage:
// 1. teamConvenience.validateExistTeam -> TeamException
// 2. fileConvenience.find... -> FileException(NOT_EXISTS_MATCHING_IMAGE_ID)
// I will use NOT_EXISTS_MATCHING_IMAGE_ID for "Image Not Found" case.
// For "Team Not Found", I should use a TeamException, but I don't have TeamException import yet?
// Let's stick to FileException cases as requested "failed cases for poster/thumbnail" usually implies file absence.
// But the prompt asked for "failure cases".
// I'll stick to FileException for consistency with previous file tests.
}
// RE-WRITING THE REPLACEMENT TO BE CORRECT

Copilot uses AI. Check for mistakes.
@@ -14,7 +14,9 @@ endif::[]

link:../opus.html[API 목록으로 돌아가기]
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The link path uses ../opus.html while other documentation files in the codebase (contest.adoc, member.adoc, notice.adoc, team-comment.adoc, team-member.adoc) consistently use ./opus.html. This should be changed to ./opus.html for consistency.

Copilot uses AI. Check for mistakes.
void 팀의_프리뷰_이미지를_조회한다() throws Exception {
// Given
final Long teamId = 1L;
final Long imageId = 100L;
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The variable 'imageId' is only assigned values of primitive type and is never 'null', but it is declared with the boxed type 'Long'.

Suggested change
final Long imageId = 100L;
final long imageId = 100L;

Copilot uses AI. Check for mistakes.
void 팀의_프리뷰_이미지_조회_실패_존재하지않음() throws Exception {
// Given
final Long teamId = 1L;
final Long imageId = 999L;
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The variable 'imageId' is only assigned values of primitive type and is never 'null', but it is declared with the boxed type 'Long'.

Copilot uses AI. Check for mistakes.
void 팀의_프리뷰_이미지_조회_실패_변환중() throws Exception {
// Given
final Long teamId = 1L;
final Long imageId = 100L;
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The variable 'imageId' is only assigned values of primitive type and is never 'null', but it is declared with the boxed type 'Long'.

Copilot uses AI. Check for mistakes.
void 팀의_프리뷰_이미지_조회_실패_물리적파일없음() throws Exception {
// Given
final Long teamId = 1L;
final Long imageId = 100L;
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The variable 'imageId' is only assigned values of primitive type and is never 'null', but it is declared with the boxed type 'Long'.

Suggested change
final Long imageId = 100L;
final long imageId = 100L;

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

🕐 간단 수정 수정 코드 100줄 이하의 간단한 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] 팀 썸네일, 팀 프리뷰, 대회 배너 관련 API의 Rest Docs 작성

3 participants