Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be/#288 MyPage API 수정 #289

Merged
merged 2 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading