-
Notifications
You must be signed in to change notification settings - Fork 2
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
test: 팔로우 소식 도메인 테스트 코드 작성 #460
Conversation
Test Results100 tests 100 ✅ 2s ⏱️ Results for commit ed8d76a. ♻️ This comment has been updated with latest results. |
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.
수고하셨습니다 !!!
return result.subList(0, Math.min(result.size(), 11)); | ||
} | ||
|
||
private boolean cursorIdLt(Long cursorId, FollowingMemoryLog followingMemoryLog) { |
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.
요기는 왜 @Override
가 없나요??
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.
FollowingMemoryLogRepository의 cursorIdLt() 메서드는 FollowingMemoryLogPersistencePort에는 없는 메서드라 @Override
를 할 수 없습니다. 또한 FollowingMemoryLogRepository의 cursorIdLt() 메서드 의 반환 타입은 BooleanExpression로 queryDSL에 종속된 클래스이므로 domain-module에 속한 persistencePort에서 사용할 수 없어 FollowingMemoryLogPersistencePort 인터페이스에 선언하지 않았습니다.
} | ||
|
||
public List<FollowingMemoryLog> getFollowingMemoryLogs() { | ||
return this.followingMemoryLogs; |
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.
이거는 테스트코드에서만 쓰이는 메서드인가요!
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.
네 테스트 코드에서만 사용하는 코드입니다.
...e-domain/src/test/java/com/depromeet/mock/followinglog/FakeFollowingMemoryLogRepository.java
Outdated
Show resolved
Hide resolved
private void saveFollowingMemoryLogs() { | ||
Member member = MemberFixture.make(memberId); | ||
List<Member> members = getMembers(); | ||
|
||
List<Memory> memories = getMemories(members); | ||
followingMemoryLogRepository.saveFriends(member, members); | ||
|
||
for (Memory m : memories) { | ||
followingMemoryLogService.save(new CreateFollowingMemoryCommand(m)); | ||
} | ||
} |
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.
저희 친구관계가 생기기 전의 log도 저장이 되었나요 !
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.
아니요. 해당 메서드는 팔로잉_소식_cursorId_없이_조회()
에서 더미 데이터를 만들기 위해 만들어진 메서드로 Member, Memory를 만든 후, 팔로우 관계를 맺은 상태에서 FollowingMemoryLog를 만드는 로직입니다. 해당 과정이 필요한 이유는 팔로잉 소식 조회 시 Friend 를 조인하여 조회하기 때문입니다.
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.
수고하셨습니다~
…toGeneratedId에 사용된 증감연산자 위치 변경 (#459)
🌱 관련 이슈
📌 작업 내용 및 특이사항
FollowingMemoryLogServiceTest
FollowingLogControllerTest
📝 참고사항
[domain-module test]
[infrastructure-module:persistence-database test]
[presentation-module test]