Skip to content

Commit

Permalink
Style: 예외 메시지 변경으로 인한 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
KimChanJin97 committed Oct 12, 2024
1 parent ee8a6ac commit b3f6d6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package cjkimhello97.toy.crashMyServer.auth.service;

import static cjkimhello97.toy.crashMyServer.auth.exception.AuthExceptionType.*;
import static cjkimhello97.toy.crashMyServer.auth.exception.AuthExceptionType.INVALID_TOKEN;
import static cjkimhello97.toy.crashMyServer.auth.exception.AuthExceptionType.NICKNAME_EXCEED_LENGTH_TEN;
import static cjkimhello97.toy.crashMyServer.auth.exception.AuthExceptionType.NICKNAME_TOO_LONG;
import static cjkimhello97.toy.crashMyServer.auth.exception.AuthExceptionType.UNAUTHORIZED;
import static cjkimhello97.toy.crashMyServer.auth.exception.AuthExceptionType.WRONG_PASSWORD;
import static java.lang.Boolean.*;
import static java.lang.Boolean.TRUE;

import cjkimhello97.toy.crashMyServer.auth.controller.dto.SignInResponse;
import cjkimhello97.toy.crashMyServer.auth.controller.dto.SignOutResponse;
import cjkimhello97.toy.crashMyServer.auth.controller.dto.TokenResponse;
import cjkimhello97.toy.crashMyServer.auth.exception.AuthException;
import cjkimhello97.toy.crashMyServer.auth.exception.AuthExceptionType;
import cjkimhello97.toy.crashMyServer.auth.infrastructure.JwtProvider;
import cjkimhello97.toy.crashMyServer.auth.service.dto.ReissueRequest;
import cjkimhello97.toy.crashMyServer.auth.service.dto.SignupRequest;
Expand Down Expand Up @@ -110,7 +109,7 @@ public SignOutResponse signOut(HttpServletRequest request, Long memberId) {

private void validateNickname(String nickname) {
if (nickname.length() > 10) {
throw new AuthException(NICKNAME_EXCEED_LENGTH_TEN);
throw new AuthException(NICKNAME_TOO_LONG);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cjkimhello97.toy.crashMyServer.service.auth;

import static cjkimhello97.toy.crashMyServer.auth.exception.AuthExceptionType.NICKNAME_EXCEED_LENGTH_TEN;
import static cjkimhello97.toy.crashMyServer.auth.exception.AuthExceptionType.NICKNAME_TOO_LONG;
import static cjkimhello97.toy.crashMyServer.service.auth.testdata.AuthServiceTestDataBuilder.*;

import cjkimhello97.toy.crashMyServer.IntegrationTest;
Expand Down Expand Up @@ -134,7 +134,7 @@ public class MysqlIntegrationTest extends IntegrationTest {
AuthException authException = Assertions.assertThrows(AuthException.class, () -> {
authService.signUp(badSignupRequest);
});
Assertions.assertEquals(authException.getExceptionType(), NICKNAME_EXCEED_LENGTH_TEN);
Assertions.assertEquals(authException.getExceptionType(), NICKNAME_TOO_LONG);
}

}

0 comments on commit b3f6d6d

Please sign in to comment.