Skip to content

[Test] RestDocs문서화#71

Merged
wlgusqkr merged 3 commits intodevfrom
feat/#70
Jan 13, 2026
Merged

[Test] RestDocs문서화#71
wlgusqkr merged 3 commits intodevfrom
feat/#70

Conversation

@wlgusqkr
Copy link
Contributor

@wlgusqkr wlgusqkr commented Jan 13, 2026

Related issue 🛠

어떤 변경사항이 있었나요?

  • 🐛 BugFix Something isn't working
  • 💻 CrossBrowsing Browser compatibility
  • 🌏 Deploy Deploy
  • 🎨 Design Markup & styling
  • 📃 Docs Documentation writing and editing (README.md, Swagger, etc.)
  • ✨ Feature Feature
  • 🔨 Refactor Code refactoring
  • ⚙️ Setting Development environment setup
  • ✅ Test Test related

Work Description ✏️

작업 내용을 작성해주세요.

  • Controller 테스트를 REST Docs로 문서화
  • AlarmQueryControllerTest, SummaryControllerTest, UrlQueryControllerTest를 새로 추가하고, FeedControllerTest FeedQueryControllerTest로 이름 변경
  • REST Docs 문서로 index.adoc에 전체 API 목차를 추가하고, feed.adoc, alarm.adoc, url.adoc, summary.adoc을 새로 생성했으며 subscription.adoc은 5개 API를 문서화
  • 테스트 설정에서는 DocumentationTestSupport에 SummaryController를 추가하고, RestDocsSupport는 삭제했으며, response-fields.snippet에서 불필요한 Optional 컬럼을 제거
  • 소스 코드에서는 SubscriptionCommandService를 SubscriptionService로 이름 변경

Uncompleted Tasks 😅

  • Task1

To Reviewers 📢

리뷰어가 알면 좋은 내용을 작성해주세요.

@wlgusqkr wlgusqkr linked an issue Jan 13, 2026 that may be closed by this pull request
@gemini-code-assist
Copy link

Summary of Changes

Hello @wlgusqkr, 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!

이 PR은 주로 Spring RestDocs를 사용하여 API 문서를 확장하고 개선하는 데 중점을 둡니다. 알림, 피드, 요약, URL과 같은 여러 API 엔드포인트에 대한 새로운 문서를 도입하고, 구독 API에 대한 기존 문서를 강화합니다. 또한, 서비스 계층의 일부 리팩토링과 테스트 지원 클래스의 통합을 포함하여 코드베이스의 전반적인 구조와 문서화를 개선합니다.

Highlights

  • RestDocs 문서화 확장: 알림, 피드, 요약, URL API에 대한 새로운 RestDocs 문서가 추가되었으며, 구독 API의 기존 문서가 목록 조회, 수정, 삭제 및 키워드 목록 조회 기능을 포함하도록 확장되었습니다.
  • 서비스 계층 리팩토링: SubscriptionCommandService가 SubscriptionService로 이름이 변경되었고, AlarmQueryController에서 SummaryCommandService 의존성이 제거되었습니다.
  • 테스트 지원 클래스 통합 및 확장: 기존 RestDocsSupport 클래스가 제거되고 DocumentationTestSupport 클래스가 여러 컨트롤러와 서비스에 대한 MockitoBean을 포함하도록 확장되어 테스트 지원이 통합되었습니다.
  • RestDocs 템플릿 업데이트: response-fields.snippet 템플릿에서 'Optional' 컬럼이 제거되어 문서 형식이 간소화되었습니다.
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.

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

github-actions bot commented Jan 13, 2026

Test Results

13 tests   13 ✅  1s ⏱️
 7 suites   0 💤
 7 files     0 ❌

Results for commit b6540e4.

♻️ This comment has been updated with latest results.

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에 대한 REST Docs 문서를 추가하고 테스트 지원 구조를 리팩토링하는 작업을 포함하고 있습니다. 전반적으로 변경 사항이 잘 구성되어 있습니다. 문서의 정확성과 코드의 일관성을 개선하기 위한 몇 가지 제안 사항을 리뷰에 담았습니다.

[[url-list]]
=== URL 목록 조회

operation::url-query-controller-test/url목록을_조회한다[snippets='http-request,http-response,response-fields']

Choose a reason for hiding this comment

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

high

operation 경로에 오타가 있어 문서 생성이 실패할 수 있습니다. UrlQueryControllerTest의 테스트 메소드 이름은 URL목록을_조회한다이므로, 스니펫이 생성되는 디렉토리 이름도 이를 따릅니다. 문서가 정상적으로 생성되려면 경로를 url-query-controller-test/URL목록을_조회한다로 수정해야 합니다.

operation::url-query-controller-test/URL목록을_조회한다[snippets='http-request,http-response,response-fields']


private final SubscriptionQueryService subscriptionQueryService;
private final SubscriptionCommandService subscriptionCommandService;
private final SubscriptionService subscriptionCommandService;

Choose a reason for hiding this comment

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

medium

SubscriptionCommandService 클래스가 SubscriptionService로 이름이 변경되었으므로, 혼동을 피하고 코드 가독성을 높이기 위해 필드명도 subscriptionService로 변경하는 것을 권장합니다. 이 변경은 해당 필드를 사용하는 다른 부분(41, 48, 65행)에도 함께 적용되어야 합니다.

Suggested change
private final SubscriptionService subscriptionCommandService;
private final SubscriptionService subscriptionService;

@@ -0,0 +1,63 @@
package com.todaysound.todaysound_server.query.alarm.presentation;

import static org.junit.jupiter.api.Assertions.*;

Choose a reason for hiding this comment

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

medium

이 import문은 파일 내에서 사용되지 않습니다. 7행의 willReturn과 18행의 DisplayName import문도 마찬가지로 사용되지 않으므로 함께 제거하여 코드를 정리하는 것이 좋겠습니다.

parameterWithName("size").description("페이지 크기")),
responseFields(fieldWithPath("errorCode").description("응답 코드"),
fieldWithPath("message").type(JsonFieldType.STRING).description("응답 메시지"),
fieldWithPath("result").type(JsonFieldType.ARRAY).description("피드 목록"),

Choose a reason for hiding this comment

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

medium

API 문서의 result 필드 설명이 "피드 목록"으로 되어 있습니다. 이 API는 알림 목록을 반환하므로, "알림 목록"으로 수정하여 명확성을 높이는 것이 좋겠습니다.

Suggested change
fieldWithPath("result").type(JsonFieldType.ARRAY).description("피드 목록"),
fieldWithPath("result").type(JsonFieldType.ARRAY).description("알림 목록"),

protected SubscriptionQueryService subscriptionQueryService;

@MockitoBean
protected SubscriptionService subscriptionCommandService;

Choose a reason for hiding this comment

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

medium

SubscriptionCommandServiceSubscriptionService로 리팩토링되었으므로, 테스트의 명확성과 일관성을 위해 Mockito 빈의 이름도 subscriptionService로 변경하는 것을 권장합니다.

Suggested change
protected SubscriptionService subscriptionCommandService;
protected SubscriptionService subscriptionService;

@wlgusqkr
Copy link
Contributor Author

/gemini review

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

이번 PR은 RestDocs를 도입하여 API 문서를 자동화하고, 전반적인 코드 명명 규칙(DTO 접미사 제거, 서비스 클래스 이름 통일)을 개선하는 등 많은 긍정적인 변경사항을 포함하고 있습니다. 테스트 코드 또한 DocumentationTestSupport를 중심으로 잘 리팩토링되었습니다. 한 가지 코드 가독성 개선을 위한 제안을 드렸으니 확인 부탁드립니다. 전체적으로 코드 품질을 높이는 좋은 작업이라고 생각합니다.

String prefix;

if(request.keywordMatched == true) {
if (request.keywordMatched == true) {

Choose a reason for hiding this comment

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

medium

boolean 타입의 변수를 true와 명시적으로 비교할 필요는 없습니다. if (request.keywordMatched)와 같이 사용하여 코드를 더 간결하게 만들 수 있습니다.

Suggested change
if (request.keywordMatched == true) {
if (request.keywordMatched) {

@wlgusqkr wlgusqkr merged commit 4e12d00 into dev Jan 13, 2026
2 checks 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.

✨ [Feat] 진짜 여러가지

1 participant