Add post listing filters and pagination

This commit is contained in:
Tim
2025-07-01 16:03:07 +08:00
parent de463e0884
commit d9e61ac756
4 changed files with 39 additions and 4 deletions

View File

@@ -81,7 +81,8 @@ class PostControllerTest {
post.setCreatedAt(LocalDateTime.now());
post.setAuthor(user);
post.setCategory(cat);
Mockito.when(postService.listPosts()).thenReturn(List.of(post));
Mockito.when(postService.listPostsByCategories(Mockito.isNull(), Mockito.isNull(), Mockito.isNull()))
.thenReturn(List.of(post));
mockMvc.perform(get("/api/posts"))
.andExpect(status().isOk())