mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-19 05:21:15 +08:00
Revert "feat: add paginated notification endpoints"
This reverts commit cc525c1c27.
This commit is contained in:
@@ -11,8 +11,6 @@ import org.mockito.Mockito;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
@@ -67,13 +65,12 @@ class NotificationServiceTest {
|
||||
when(uRepo.findByUsername("bob")).thenReturn(Optional.of(user));
|
||||
|
||||
Notification n = new Notification();
|
||||
when(nRepo.findByUserOrderByCreatedAtDesc(eq(user), any(Pageable.class)))
|
||||
.thenReturn(new PageImpl<>(List.of(n)));
|
||||
when(nRepo.findByUserOrderByCreatedAtDesc(user)).thenReturn(List.of(n));
|
||||
|
||||
List<Notification> list = service.listNotifications("bob", null, 0, 10);
|
||||
List<Notification> list = service.listNotifications("bob", null);
|
||||
|
||||
assertEquals(1, list.size());
|
||||
verify(nRepo).findByUserOrderByCreatedAtDesc(eq(user), any(Pageable.class));
|
||||
verify(nRepo).findByUserOrderByCreatedAtDesc(user);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user