DATACMNS-800 - Add deleteAllById to CoroutineCrudRepository.
Original pull request: #476.
This commit is contained in:
@@ -132,6 +132,15 @@ interface CoroutineCrudRepository<T, ID> : Repository<T, ID> {
|
||||
*/
|
||||
suspend fun delete(entity: T)
|
||||
|
||||
/**
|
||||
* Deletes all instances of the type `T` with the given IDs.
|
||||
*
|
||||
* @param ids must not be null nor contain any null values.
|
||||
* @throws IllegalArgumentException in case the given [ids][Iterable] or one of its items is null.
|
||||
* @since 2.5
|
||||
*/
|
||||
suspend fun deleteAllById(ids: Iterable<ID>)
|
||||
|
||||
/**
|
||||
* Deletes the given entities.
|
||||
*
|
||||
|
||||
@@ -140,6 +140,18 @@ class CoroutineCrudRepositoryUnitTests {
|
||||
assertThat(result).isTrue()
|
||||
}
|
||||
|
||||
@Test // DATACMNS-800
|
||||
fun shouldInvokeDeleteAllById() {
|
||||
|
||||
every { backingRepository.deleteAllById(listOf("foo", "bar")) } returns Mono.empty()
|
||||
|
||||
runBlocking {
|
||||
coRepository.deleteAllById(listOf("foo", "bar"))
|
||||
}
|
||||
|
||||
verify { backingRepository.deleteAllById(listOf("foo", "bar")) }
|
||||
}
|
||||
|
||||
@Test // DATACMNS-1508
|
||||
fun shouldInvokeDeleteAll() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user