Skip to content
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 @@ -14,8 +14,8 @@ public interface CommentRepository extends JpaRepository<Comment, Long> {
SELECT c
FROM Comment c
WHERE c.postId = :postId
AND (:cursor is null or c.id < :cursor)
ORDER BY c.createdAt DESC
AND (:cursor is null or c.id > :cursor)
ORDER BY c.createdAt ASC
""")
Slice<Comment> findByPostId(
@Param("postId") Long postId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ void select_CommentUser() {
Slice<Comment> result2 = commentRepository.findByPostId(1L, 1L, PageRequest.of(0, 10));

// then2
assertThat(result2.getContent()).hasSize(0);
assertThat(result2.getContent()).hasSize(2);
}
}