Skip to content

Commit

Permalink
refactor: 테스트 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
shinseongsu committed Dec 3, 2023
1 parent 418b0e7 commit ef6cdb8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void vaildate() {

assertThat(result.jsonPath().getString("code")).isEqualTo(ExceptionCode.SUCCESS.getCode());
assertThat(result.jsonPath().getString("message")).isEqualTo(ExceptionCode.SUCCESS.getDescription());
assertThat(result.jsonPath().getString("userId")).isEqualTo(registerRequest.userId());
assertThat(result.jsonPath().getString("userEmail")).isEqualTo(registerRequest.userId());
}

@DisplayName("레디스에 로그인 되어 있지 않을때, 에러를 반환한다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private static ResponseFieldsSnippet responseFieldsSnippet() {
return responseFields(
fieldWithPath("code").type(JsonFieldType.STRING).description("상태코드"),
fieldWithPath("message").type(JsonFieldType.STRING).description("응답 메시지"),
fieldWithPath("userId").type(JsonFieldType.STRING).description("유저 아이디"),
fieldWithPath("userEmail").type(JsonFieldType.STRING).description("유저 아이디"),
fieldWithPath("id").type(JsonFieldType.NUMBER).description("아이디")
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.flab.investing.user.integration;

import com.flab.investing.global.error.exception.NotFoundUserIdException;
import com.flab.investing.global.error.exception.constant.ExceptionMessage;
import com.flab.investing.user.application.UserService;
import com.flab.investing.user.controller.request.RegisterRequest;
import com.flab.investing.user.domain.User;
Expand Down Expand Up @@ -48,8 +50,8 @@ void notFoundMemberException() {
assertThatThrownBy(() -> {
userService.getUserId("[email protected]");
})
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("존재하지 않는 아이디입니다.");
.isInstanceOf(NotFoundUserIdException.class)
.hasMessage(ExceptionMessage.NOTFOUND_USER.getMessage());

}

Expand Down

0 comments on commit ef6cdb8

Please sign in to comment.