-
Notifications
You must be signed in to change notification settings - Fork 1
[#10] feat: User 관련 길이 제한을 도메인으로 이동 #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,20 @@ | ||
| package com.nexters.teamace.auth.presentation; | ||
|
|
||
| import com.nexters.teamace.common.exception.ValidationErrorMessage; | ||
| import com.nexters.teamace.user.domain.User; | ||
| import jakarta.validation.constraints.NotBlank; | ||
| import jakarta.validation.constraints.Size; | ||
|
|
||
| public record SignupRequest( | ||
| @NotBlank(message = ValidationErrorMessage.USERNAME_NOT_BLANK) | ||
| @Size(min = 1, max = 20, message = ValidationErrorMessage.USERNAME_SIZE) | ||
| @Size( | ||
| min = 1, | ||
| max = User.MAX_USERNAME_LENGTH, | ||
| message = ValidationErrorMessage.USERNAME_SIZE) | ||
| String username, | ||
| @NotBlank(message = ValidationErrorMessage.NICKNAME_NOT_BLANK) | ||
| @Size(min = 1, max = 20, message = ValidationErrorMessage.NICKNAME_SIZE) | ||
| @Size( | ||
| min = 1, | ||
| max = User.MAX_NICKNAME_LENGTH, | ||
| message = ValidationErrorMessage.NICKNAME_SIZE) | ||
| String nickname) {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,17 +66,17 @@ void it_throws_IllegalArgumentException() { | |
| } | ||
|
|
||
| @Nested | ||
| @DisplayName("20자보다 긴 사용자명으로 생성할 때") | ||
| @DisplayName("50자보다 긴 사용자명으로 생성할 때") | ||
| class Context_when_creating_with_username_longer_than_20_characters { | ||
|
|
||
| @Test | ||
| @DisplayName("IllegalArgumentException을 던진다") | ||
| void it_throws_IllegalArgumentException() { | ||
| final String longUsername = "a".repeat(21); | ||
| final String longUsername = "a".repeat(51); | ||
|
|
||
| thenThrownBy(() -> new CreateUserCommand(longUsername, "Valid User")) | ||
| .isInstanceOf(IllegalArgumentException.class) | ||
| .hasMessage("Username must be between 1 and 20 characters"); | ||
| .hasMessage("Username must be between 1 and 50 characters"); | ||
|
Comment on lines
+69
to
+79
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chain레거시 명칭/문구 잔존 여부 점검 스크립트 다른 테스트의 컨텍스트 클래스명이나 메시지에 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "컨텍스트 클래스명에 'longer_than_20_characters' 잔존 검색"
rg -nP -C2 'longer_than_20_characters' --type=java
echo
echo "Username 관련 'between 1 and 20 characters' 메시지 잔존 검색"
rg -nP -C2 'Username must be between 1 and 20 characters' --type=javaLength of output: 3055 테스트 컨텍스트 클래스명 ‘…_20_characters’ → ‘…_50_characters’로 일관성 있게 수정 필요 아래 테스트 파일들에서 컨텍스트 클래스명이 아직
🤖 Prompt for AI Agents |
||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
매직 넘버 제거한 거 아주 좋습니다👍👍👍👍