-
Notifications
You must be signed in to change notification settings - Fork 6
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
Conversation
val friend = friendRelation.friend | ||
val profileImgUrl = friend.file?.let { imagePath.resolve(it) } | ||
GetFriendResponse(friend.id!!, friend.username, friend.email, profileImgUrl) | ||
}.collect(Collectors.toList()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
collect(Collectors.toList())
-> toList()
메서드를 적용하는 것도 좋아보이네요!
/** | ||
* 로그인한 사용자가 친구목록을 조회하는 메서드 | ||
* | ||
* @param userId : 로그인한 사용자의 ID. | ||
* @return 로그인한 사용자 ID, 해당 사용자가 조회하고자 하는 친구목록을 담은 GetFriendsResponse 리턴 | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
인터페이스를 통해서 노출된 메서드의 주석 좋네요.
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 | ||
} |
There was a problem hiding this comment.
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("친구조회_성공") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given when then으로 상황을 주석으로 분리하면 좀 더 파악하기 쉬울 것 같아요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 주석 추가하겠습니다!
#️⃣연관된 이슈
📝작업 내용