Skip to content

Commit

Permalink
Merge pull request #63 from KimChanJin97/feat
Browse files Browse the repository at this point in the history
Style: 예외 메시지 수정으로 인한 코드 수정
  • Loading branch information
KimChanJin97 authored Oct 12, 2024
2 parents bca676b + b3f6d6d commit 869a68a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public enum AuthExceptionType implements ExceptionType {

// 회원가입
WRONG_PASSWORD(Status.BAD_REQUEST, 4007, "WRONG PASSWORD"),
NICKNAME_EXCEED_LENGTH_TEN(Status.BAD_REQUEST, 4008, "NICKNAME EXCEED LENGTH TEN"),
NICKNAME_TOO_LONG(Status.BAD_REQUEST, 4008, "NICKNAME TOO LONG"),
ALREADY_SIGN_OUT(Status.UNAUTHORIZED, 4009, "ALREADY SIGN OUT")
;

Expand Down
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
Expand Up @@ -22,7 +22,7 @@ public KafkaAdmin kafkaAdmin() {
Map<String, Object> adminProps = new HashMap<>();
adminProps.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, kafkaConstants.KAFKA_BROKER);
adminProps.put(AdminClientConfig.REQUEST_TIMEOUT_MS_CONFIG, 5000); // 메타데이터 요청 타임아웃
adminProps.put(AdminClientConfig.CONNECTIONS_MAX_IDLE_MS_CONFIG, 6000); // 브로커 연결 유지 최대 시간
adminProps.put(AdminClientConfig.CONNECTIONS_MAX_IDLE_MS_CONFIG, 60000); // 브로커 연결 유지 최대 시간
return new KafkaAdmin(adminProps);
}

Expand Down
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 869a68a

Please sign in to comment.