Skip to content

Commit

Permalink
refactor : 유저 이름 필드 네이밍 통일
Browse files Browse the repository at this point in the history
  • Loading branch information
1000kkannoo authored and JunHwan Kim committed Feb 13, 2024
1 parent 897b663 commit 0ed204c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static Login response(Users user, String atk, String rtk) {
public static class Detail {
private Long id;
private String email;
private String nickName;
private String name;
private String imageUrl;
private String interests;

Expand All @@ -52,7 +52,7 @@ public static UserResponse.Detail response(Users user) {
return Detail.builder()
.id(user.getId())
.email(user.getEmail())
.nickName(user.getNickName())
.name(user.getNickName())
.imageUrl(user.getImageUrl())
.interests(interestOptional.orElse(""))
.build();
Expand Down
11 changes: 4 additions & 7 deletions src/test/java/dnd/project/docs/user/UserControllerDocsTest.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package dnd.project.docs.user;

import com.epages.restdocs.apispec.ResourceSnippetParameters;
import com.epages.restdocs.apispec.Schema;
import dnd.project.docs.RestDocsSupport;
import dnd.project.domain.user.config.Platform;
import dnd.project.domain.user.controller.UserController;
Expand All @@ -10,11 +9,9 @@
import dnd.project.domain.user.service.UserService;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.http.HttpHeaders;
import org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders;
import org.springframework.restdocs.mockmvc.RestDocumentationResultHandler;
import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;

import java.util.List;

Expand Down Expand Up @@ -150,7 +147,7 @@ void detailUser() throws Exception {
.willReturn(UserResponse.Detail.builder()
.id(1L)
.email("[email protected]")
.nickName("클래스코프")
.name("클래스코프")
.imageUrl("http://www.aws.../image.png")
.interests("디자인,드로잉 / 관심분야 없을시 : 빈 문자열 ")
.build());
Expand Down Expand Up @@ -180,7 +177,7 @@ void detailUser() throws Exception {
.description("유저 ID"),
fieldWithPath("data.email").type(STRING)
.description("유저 이메일"),
fieldWithPath("data.nickName").type(STRING)
fieldWithPath("data.name").type(STRING)
.description("유저 닉네임"),
fieldWithPath("data.imageUrl").type(STRING)
.description("유저 프로필 이미지 URL"),
Expand All @@ -200,7 +197,7 @@ void updateUser() throws Exception {
UserResponse.Detail.builder()
.id(1L)
.email("[email protected]")
.nickName("클래스코프")
.name("클래스코프")
.imageUrl("http://www.aws.../image.png")
.interests("프로그래밍,커리어")
.build()
Expand Down Expand Up @@ -239,7 +236,7 @@ void updateUser() throws Exception {
.description("유저 ID"),
fieldWithPath("data.email").type(STRING)
.description("유저 이메일"),
fieldWithPath("data.nickName").type(STRING)
fieldWithPath("data.name").type(STRING)
.description("유저 닉네임"),
fieldWithPath("data.imageUrl").type(STRING)
.description("유저 프로필 이미지 URL"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void detailUser() {

// then
assertThat(response)
.extracting("id", "email", "nickName", "imageUrl", "interests")
.extracting("id", "email", "name", "imageUrl", "interests")
.contains(
user.getId(), user.getEmail(), user.getNickName(),
user.getImageUrl(), user.getInterests()
Expand All @@ -109,7 +109,7 @@ void detailUserNotInterest() {

// then
assertThat(response)
.extracting("id", "email", "nickName", "imageUrl", "interests")
.extracting("id", "email", "name", "imageUrl", "interests")
.contains(
user.getId(), user.getEmail(), user.getNickName(),
user.getImageUrl(), ""
Expand Down

0 comments on commit 0ed204c

Please sign in to comment.