-
Notifications
You must be signed in to change notification settings - Fork 3
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
[BE] 닉네임 검증 정규표현식 삭제 및 앞 뒤 공백 제거 로직 추가 #168
Conversation
} | ||
|
||
private void validate(final String value) { | ||
if (StringUtils.isBlank(value)) { | ||
throw new InvalidNameFormatException("페어의 이름이 비어있습니다."); | ||
} | ||
if (value.length() > MAX_LENGTH) { | ||
throw new InvalidNameFormatException("이름은 10자 이하여야 합니다."); | ||
throw new InvalidNameFormatException(String.format("이름은 %d자 이하여야 합니다.", MAX_LENGTH)); |
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.
공백을 제거한다음 10자인걸 확인해줘야 할거 같아요!
@@ -13,7 +13,7 @@ | |||
class PairNameTest { | |||
|
|||
@ParameterizedTest | |||
@ValueSource(strings = {"레디!", "파슬리 🌿", "ㄹ ㅔ ㅁ ㄴ ㅔ", "lemone"}) | |||
@ValueSource(strings = {"레디!", "파슬리 🌿", "여 왕 님", "lemon", "abcdeabcde"}) |
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.
👸
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.
LGTM
@Test | ||
@DisplayName("공백이 제거 된 후 10 글자 이하 닉네임은 허용한다.") | ||
void allow_10_characters_with_trim_name_length() { | ||
// given |
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.
테스트 추가 구우웃!!!
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.
LGTM 🧑💻
@@ -13,7 +13,7 @@ | |||
class PairNameTest { | |||
|
|||
@ParameterizedTest | |||
@ValueSource(strings = {"레디!", "파슬리 🌿", "ㄹ ㅔ ㅁ ㄴ ㅔ", "lemone"}) | |||
@ValueSource(strings = {"레디!", "파슬리 🌿", "여 왕 님", "lemon", "abcdeabcde"}) | |||
@DisplayName("한글, 한글 자음 & 모음, 영어, 기호, 이모지가 들어간 이름을 생성한다.") | |||
void create_name_contains_special_character(String validName) { |
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.
void create_name_contains_special_character(String validName) { | |
void create_name_contains_special_character(final String validName) { |
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.
해당 누락 Final 같이 다음 이슈에서 수정 PR하겠습니다.😊`
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.
Goooood~~~
연관된 이슈
구현한 기능
상세 설명
닉네임은 중간 공백은 허용한다는 정책 및 러프하게 이모지, 영어, 숫자는 허용하기 위한 코드 수정입니다.