mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-14 19:10:58 +08:00
feat: add paginated notifications and unread endpoint
This commit is contained in:
@@ -65,12 +65,12 @@ class NotificationServiceTest {
|
||||
when(uRepo.findByUsername("bob")).thenReturn(Optional.of(user));
|
||||
|
||||
Notification n = new Notification();
|
||||
when(nRepo.findByUserOrderByCreatedAtDesc(user)).thenReturn(List.of(n));
|
||||
when(nRepo.findByUser(eq(user), any())).thenReturn(new org.springframework.data.domain.PageImpl<>(List.of(n)));
|
||||
|
||||
List<Notification> list = service.listNotifications("bob", null);
|
||||
List<Notification> list = service.listNotifications("bob", null, 0, 50);
|
||||
|
||||
assertEquals(1, list.size());
|
||||
verify(nRepo).findByUserOrderByCreatedAtDesc(user);
|
||||
verify(nRepo).findByUser(eq(user), any());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user