This commit is contained in:
@@ -425,7 +425,7 @@ public class BookService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bookRepository.deleteAll(books);
|
bookRepository.deleteAllInBatch(books);
|
||||||
auditService.log(AuditAction.BOOK_DELETED, "Deleted " + ids.size() + " book(s)");
|
auditService.log(AuditAction.BOOK_DELETED, "Deleted " + ids.size() + " book(s)");
|
||||||
BookDeletionResponse response = new BookDeletionResponse(ids, failedFileDeletions);
|
BookDeletionResponse response = new BookDeletionResponse(ids, failedFileDeletions);
|
||||||
return failedFileDeletions.isEmpty()
|
return failedFileDeletions.isEmpty()
|
||||||
|
|||||||
@@ -374,7 +374,7 @@ class BookServiceTest {
|
|||||||
Files.createDirectories(filePath.getParent());
|
Files.createDirectories(filePath.getParent());
|
||||||
Files.write(filePath, "abc".getBytes());
|
Files.write(filePath, "abc".getBytes());
|
||||||
|
|
||||||
doNothing().when(bookRepository).deleteAll(anyList());
|
doNothing().when(bookRepository).deleteAllInBatch(anyList());
|
||||||
when(bookQueryService.findAllWithMetadataByIds(Set.of(11L))).thenReturn(List.of(entity));
|
when(bookQueryService.findAllWithMetadataByIds(Set.of(11L))).thenReturn(List.of(entity));
|
||||||
when(authenticationService.getAuthenticatedUser()).thenReturn(testUser);
|
when(authenticationService.getAuthenticatedUser()).thenReturn(testUser);
|
||||||
|
|
||||||
@@ -405,7 +405,7 @@ class BookServiceTest {
|
|||||||
|
|
||||||
when(bookQueryService.findAllWithMetadataByIds(Set.of(13L))).thenReturn(List.of(entity));
|
when(bookQueryService.findAllWithMetadataByIds(Set.of(13L))).thenReturn(List.of(entity));
|
||||||
when(authenticationService.getAuthenticatedUser()).thenReturn(testUser);
|
when(authenticationService.getAuthenticatedUser()).thenReturn(testUser);
|
||||||
doNothing().when(bookRepository).deleteAll(anyList());
|
doNothing().when(bookRepository).deleteAllInBatch(anyList());
|
||||||
|
|
||||||
BookDeletionResponse response = bookService.deleteBooks(Set.of(13L)).getBody();
|
BookDeletionResponse response = bookService.deleteBooks(Set.of(13L)).getBody();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user