Allow empty Iterable arguments in JdbcAggregateTemplate again.

This also affects repositories since they delegate to the template.

Closes #1401
This commit is contained in:
Jens Schauder
2023-01-03 09:34:15 +01:00
parent 5d3e737393
commit 1ff403e174
2 changed files with 27 additions and 3 deletions

View File

@@ -312,6 +312,21 @@ public class JdbcAggregateTemplateUnitTests {
assertThat(all).containsExactly(alfred2, neumann2);
}
@Test // GH-1401
public void saveAllWithEmptyListDoesNothing() {
assertThat(template.saveAll(emptyList())).isEmpty();
}
@Test // GH-1401
public void deleteAllWithEmptyListDoesNothing() {
template.deleteAll(emptyList());
}
@Test // GH-1401
public void deleteAllByIdWithEmptyListDoesNothing() {
template.deleteAllById(emptyList(), SampleEntity.class);
}
@Data
@AllArgsConstructor
private static class SampleEntity {