Skip to content

Commit

Permalink
Merge pull request #289 from techeer-sv/BE/#288
Browse files Browse the repository at this point in the history
Be/#288 MyPage API 수정
  • Loading branch information
baekhangyeol authored Nov 10, 2023
2 parents e652e2d + 2349b3d commit 89d217b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor
public class GetMyPageResponse {
private Long id;
private String nickname;
private String introduction;
private int followerCount;
Expand All @@ -20,6 +21,7 @@ public class GetMyPageResponse {
public static GetMyPageResponse of(Member member,
List<GetProjectInfoResponse> getProjectInfoResponseList) {
return GetMyPageResponse.builder()
.id(member.getId())
.nickname(member.getNickname())
.introduction(member.getIntroduction())
.followerCount(member.getFollowerCount())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ void findMemberTest() throws Exception {
@DisplayName("현재 로그인한 사용자의 정보로 마이페이지를 조회한다")
void getMyPageTest() throws Exception {
GetMyPageResponse result = GetMyPageResponse.builder()
.id(member1.getId())
.nickname(member1.getNickname())
.introduction(member1.getIntroduction())
.followerCount(member1.getFollowerCount())
Expand All @@ -149,6 +150,7 @@ void getMyPageTest() throws Exception {
.andDo(print())
.andExpect(status().isOk())

.andExpect(jsonPath("$.data.id").value((member1.getId())))
.andExpect(jsonPath("$.data.nickname").value(member1.getNickname()))
.andExpect(jsonPath("$.data.introduction").value(member1.getIntroduction()))
.andExpect(jsonPath("$.data.followerCount").value(member1.getFollowerCount()))
Expand All @@ -169,6 +171,7 @@ void getMyPageTest() throws Exception {
fieldWithPath("message").description("응답 메시지"),
fieldWithPath("data").description("응답 데이터"),

fieldWithPath("data.id").description("유저 PK"),
fieldWithPath("data.nickname").description("닉네임"),
fieldWithPath("data.introduction").description("본인 소개"),
fieldWithPath("data.followerCount").description("팔로워 수"),
Expand Down

0 comments on commit 89d217b

Please sign in to comment.