Feature/#54 이미지 관련 api의 rest docs 작성#68
Conversation
There was a problem hiding this comment.
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.
| @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 | ||
|
|
There was a problem hiding this comment.
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.
| @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 | |
| @@ -14,7 +14,9 @@ endif::[] | |||
|
|
|||
| link:../opus.html[API 목록으로 돌아가기] | |||
There was a problem hiding this comment.
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.
| void 팀의_프리뷰_이미지를_조회한다() throws Exception { | ||
| // Given | ||
| final Long teamId = 1L; | ||
| final Long imageId = 100L; |
There was a problem hiding this comment.
The variable 'imageId' is only assigned values of primitive type and is never 'null', but it is declared with the boxed type 'Long'.
| final Long imageId = 100L; | |
| final long imageId = 100L; |
| void 팀의_프리뷰_이미지_조회_실패_존재하지않음() throws Exception { | ||
| // Given | ||
| final Long teamId = 1L; | ||
| final Long imageId = 999L; |
There was a problem hiding this comment.
The variable 'imageId' is only assigned values of primitive type and is never 'null', but it is declared with the boxed type 'Long'.
| void 팀의_프리뷰_이미지_조회_실패_변환중() throws Exception { | ||
| // Given | ||
| final Long teamId = 1L; | ||
| final Long imageId = 100L; |
There was a problem hiding this comment.
The variable 'imageId' is only assigned values of primitive type and is never 'null', but it is declared with the boxed type 'Long'.
| void 팀의_프리뷰_이미지_조회_실패_물리적파일없음() throws Exception { | ||
| // Given | ||
| final Long teamId = 1L; | ||
| final Long imageId = 100L; |
There was a problem hiding this comment.
The variable 'imageId' is only assigned values of primitive type and is never 'null', but it is declared with the boxed type 'Long'.
| final Long imageId = 100L; | |
| final long imageId = 100L; |
🔥 연관된 이슈
close: #54
📜 작업 내용
💬 리뷰 요구사항
✨ 기타