Fix: Two users cannot put the same book on their Kobo shelves (#1189)

This commit is contained in:
Aditya Chandel
2025-09-22 18:04:41 -06:00
committed by GitHub
parent c82bc3ced7
commit 6565368a55
5 changed files with 46 additions and 82 deletions
@@ -192,12 +192,12 @@ class OpdsServiceTest {
when(request.getHeader("Accept")).thenReturn(null); // v1 default; feed version not relevant for allowed-books logic
when(request.getRequestURI()).thenReturn("/opds/catalog");
when(bookQueryService.getAllBooksByLibraryIds(Set.of(7L), true)).thenReturn(List.of());
when(bookQueryService.getAllBooksByLibraryIds(Set.of(7L), true, 21L)).thenReturn(List.of());
String feed = service.generateCatalogFeed(request);
assertNotNull(feed);
verify(bookQueryService).getAllBooksByLibraryIds(Set.of(7L), true);
verify(bookQueryService).getAllBooksByLibraryIds(Set.of(7L), true, 21L);
verify(userRepository).findById(21L);
}