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

[User] 친구목록 조회 API 구현 #202

Merged
merged 7 commits into from
Jun 28, 2024

Conversation

minahYu
Copy link
Contributor

@minahYu minahYu commented Jun 26, 2024

#️⃣연관된 이슈

📝작업 내용

  • 친구목록 조회 API 를 구현하였습니다.
  • 친구목록 조회 Controller 테스트코드를 작성하였습니다.
  • 친구목록 조회 Service 테스트코드를 작성하였습니다.

@minahYu minahYu added enhancement 추가 기능 API 상세 api 문서 Test 테스트 코드 User 유저 관련기능 labels Jun 26, 2024
@minahYu minahYu added this to the MSA 채팅 서비스 개발 milestone Jun 26, 2024
@minahYu minahYu requested a review from a team June 26, 2024 09:10
@minahYu minahYu self-assigned this Jun 26, 2024
val friend = friendRelation.friend
val profileImgUrl = friend.file?.let { imagePath.resolve(it) }
GetFriendResponse(friend.id!!, friend.username, friend.email, profileImgUrl)
}.collect(Collectors.toList())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collect(Collectors.toList()) -> toList() 메서드를 적용하는 것도 좋아보이네요!

Comment on lines +17 to +22
/**
* 로그인한 사용자가 친구목록을 조회하는 메서드
*
* @param userId : 로그인한 사용자의 ID.
* @return 로그인한 사용자 ID, 해당 사용자가 조회하고자 하는 친구목록을 담은 GetFriendsResponse 리턴
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

인터페이스를 통해서 노출된 메서드의 주석 좋네요.

Comment on lines +253 to +258
mockk<User> {
every { id } returns CommonTest.TEST_FRIEND_ID
every { username } returns CommonTest.TEST_FRIEND_USERNAME
every { email } returns CommonTest.TEST_FRIEND_EMAIL
every { file } returns CommonTest.TEST_PROFILE_IMG
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이런식으로 모킹을 할 수 있군요!

@@ -244,4 +245,37 @@ internal class FriendServiceImplTest : FunSpec({
}
exception.errorCode.message() shouldBe "해당하는 친구가 없습니다."
}

test("친구조회_성공") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given when then으로 상황을 주석으로 분리하면 좀 더 파악하기 쉬울 것 같아요.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 주석 추가하겠습니다!

@minahYu minahYu merged commit f8eaf36 into kSideProject:dev Jun 28, 2024
1 check passed
@minahYu minahYu deleted the feat/get-friends branch June 28, 2024 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API 상세 api 문서 enhancement 추가 기능 Test 테스트 코드 User 유저 관련기능
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants