Skip to content

test: 닉네임 시작/끝 숫자 허용 스펙에 맞게 NicknameValidatorTest 기대값 수정#391

Merged
pooreumjung merged 2 commits into
developfrom
fix/#388-validate-nickname-edges
Jul 5, 2026
Merged

test: 닉네임 시작/끝 숫자 허용 스펙에 맞게 NicknameValidatorTest 기대값 수정#391
pooreumjung merged 2 commits into
developfrom
fix/#388-validate-nickname-edges

Conversation

@pooreumjung

Copy link
Copy Markdown
Member

#️⃣ Issue Number

📝 요약(Summary)

  • NicknameValidatorTest에서 숫자로 시작/끝나는 닉네임(0이름, 0test, 이름0, test0)을 예외 발생 케이스로 잘못 기대하고 있던 테스트를 수정
  • NicknameValidator의 정규식(프로덕션 코드)은 수정하지 않음 — BaseResponseStatus.INVALID_START_OF_NICKNAME/INVALID_END_OF_NICKNAME의 실제 사용자 노출 메시지("첫/마지막 글자는 한글, 영문, 숫자만 사용할 수 있습니다")에 숫자가 명시적으로 허용 문자로 포함되어 있어, 실제 버그는 정규식이 아니라 테스트의 기대값이 스펙과 어긋나 있던 것으로 확인됨
  • 해당 4개 케이스를 "예외가 발생한다" 파라미터에서 제거하고, "유효한_이름을_입력하면_예외가_발생하지_않는다" 테스트의 파라미터로 이동

💬 공유사항 to 리뷰어

  • 프로덕션 코드(NicknameValidator.java)는 변경하지 않았습니다. 판단 근거는 BaseResponseStatus에 이미 정의된 사용자 노출 에러 메시지 텍스트이며, 혹시 그 메시지 자체가 잘못 작성된 것이고 실제로는 숫자 시작/끝을 막아야 하는 게 맞다면 반대 방향(정규식 수정)으로 다시 논의가 필요합니다.
  • 로컬에서 ./gradlew test로 전체 스위트(84개) 통과 확인했습니다. #387(Ratings NPE) 수정이 이미 develop에 반영된 상태에서 검증했고, 이번 수정으로 나머지 4건도 모두 통과해 현재 develop 기준 전체 테스트가 그린 상태입니다.

✅ PR Checklist

PR이 다음 요구 사항을 충족하는지 확인하세요.

  • 커밋 메시지 컨벤션에 맞게 작성했습니다.
  • 변경 사항에 대한 테스트를 했습니다.(버그 수정/기능에 대한 테스트).

resolved #388

BaseResponseStatus의 INVALID_START/END_OF_NICKNAME 메시지에 숫자가 허용 문자로
명시되어 있어, 실제 구현(정규식)이 아니라 테스트의 기대값이 스펙과 어긋나 있었음

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@pooreumjung pooreumjung added the fix 고치기 label Jul 4, 2026
@pooreumjung pooreumjung self-assigned this Jul 4, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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은 닉네임 유효성 검사 로직의 테스트 코드와 실제 스펙 간의 불일치를 해결하기 위한 변경입니다. 프로덕션 코드의 정규식은 유지하되, 숫자로 시작하거나 끝나는 닉네임을 예외로 처리하던 테스트 케이스를 수정하여 명시된 스펙에 부합하도록 조정하였습니다.

Highlights

  • 테스트 케이스 수정: 닉네임 시작과 끝에 숫자를 허용하는 스펙에 맞춰 NicknameValidatorTest의 기대값을 수정했습니다.
  • 테스트 파라미터 이동: 기존에 예외 발생 케이스로 분류되었던 숫자 포함 닉네임들을 유효한 닉네임 테스트 케이스로 이동시켰습니다.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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 the 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 counterproductive. 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.


닉네임 검사 스펙을 보며, 테스트 코드 다시 쓰네. 숫자는 허용되어야 하니, 이제는 모두 통과하네.

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.

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

이번 풀리퀘스트는 닉네임 유효성 검증 시 숫자로 시작하거나 끝나는 닉네임을 허용하도록 테스트 케이스를 수정한 변경사항을 포함하고 있습니다. 리뷰 피드백에서는 저장소 스타일 가이드에 따라 테스트 메서드 이름을 영문으로 작성하고 테스트 내에 'given, when, then' 주석을 추가할 것을 지적했습니다. 또한, 숫자가 허용됨에 따라 기존의 '한글 또는 영어로 시작/끝나지 않는 경우'라는 테스트 메서드 이름이 현재 검증 로직과 맞지 않으므로, 이를 반영하여 이름을 수정할 것을 권장하고 있습니다.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@pooreumjung pooreumjung merged commit 5bf02c7 into develop Jul 5, 2026
@pooreumjung pooreumjung deleted the fix/#388-validate-nickname-edges branch July 5, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix 고치기

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: NicknameValidator 시작/끝 문자 검증 정규식에 숫자가 허용되어 있어 검증 누락

1 participant