From 1a9b09366f7fbec0e6f93a20ffd41224e6c697d9 Mon Sep 17 00:00:00 2001 From: chaerim Date: Sun, 24 Sep 2023 18:14:40 +0900 Subject: [PATCH] refactor(member): add university authentication status data to response values in member details API --- .../wemeet/dto/response/member/MemberDetailResponseDto.java | 4 +++- .../e2i/wemeet/controller/member/MemberControllerTest.java | 4 +++- .../com/e2i/wemeet/service/member/MemberServiceTest.java | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/e2i/wemeet/dto/response/member/MemberDetailResponseDto.java b/src/main/java/com/e2i/wemeet/dto/response/member/MemberDetailResponseDto.java index c8697fc9..0c3ecedb 100644 --- a/src/main/java/com/e2i/wemeet/dto/response/member/MemberDetailResponseDto.java +++ b/src/main/java/com/e2i/wemeet/dto/response/member/MemberDetailResponseDto.java @@ -13,7 +13,8 @@ public record MemberDetailResponseDto( String college, String collegeType, String admissionYear, - ProfileImageResponseDto profileImage + ProfileImageResponseDto profileImage, + Boolean authUnivStatus ) { public static MemberDetailResponseDto of(final Member member, final String college) { @@ -27,6 +28,7 @@ public static MemberDetailResponseDto of(final Member member, final String colle .collegeType(member.getCollegeInfo().getCollegeType().getDescription()) .admissionYear(member.getCollegeInfo().getAdmissionYear()) .profileImage(profileImage) + .authUnivStatus(member.getEmail() != null) .build(); } } diff --git a/src/test/java/com/e2i/wemeet/controller/member/MemberControllerTest.java b/src/test/java/com/e2i/wemeet/controller/member/MemberControllerTest.java index e4ab3859..1f096fec 100644 --- a/src/test/java/com/e2i/wemeet/controller/member/MemberControllerTest.java +++ b/src/test/java/com/e2i/wemeet/controller/member/MemberControllerTest.java @@ -288,7 +288,9 @@ private void getMemberDetailWriteRestDocs(ResultActions perform) throws Exceptio fieldWithPath("data.profileImage.basicUrl").type(JsonFieldType.STRING) .description("회원 개인 프로필 사진 원본"), fieldWithPath("data.profileImage.lowUrl").type(JsonFieldType.STRING) - .description("회원 개인 프로필 사진 저해상도") + .description("회원 개인 프로필 사진 저해상도"), + fieldWithPath("data.authUnivStatus").type(JsonFieldType.BOOLEAN) + .description("대학 인증 여부") ) )); } diff --git a/src/test/java/com/e2i/wemeet/service/member/MemberServiceTest.java b/src/test/java/com/e2i/wemeet/service/member/MemberServiceTest.java index 33b33757..44c068c0 100644 --- a/src/test/java/com/e2i/wemeet/service/member/MemberServiceTest.java +++ b/src/test/java/com/e2i/wemeet/service/member/MemberServiceTest.java @@ -214,8 +214,9 @@ void readMemberInfo_Success() { MemberDetailResponseDto memberDetailResponseDto = memberService.readMemberDetail( kai.getMemberId()); assertThat(memberDetailResponseDto).isNotNull() - .extracting("nickname", "college", "collegeType", "mbti", "admissionYear") - .contains(kai.getNickname(), "안양대", "인문사회", Mbti.INFJ, "17"); + .extracting("nickname", "college", "collegeType", "mbti", "admissionYear", + "authUnivStatus") + .contains(kai.getNickname(), "안양대", "인문사회", Mbti.INFJ, "17", true); } @DisplayName("회원 ID가 잘못되었을 경우, 회원 정보를 조회할 수 없다.")