|
33 | 33 | import jakarta.persistence.criteria.Root;
|
34 | 34 | import lombok.Data;
|
35 | 35 |
|
36 |
| -import java.util.*; |
| 36 | +import java.util.ArrayList; |
| 37 | +import java.util.Collection; |
| 38 | +import java.util.Collections; |
| 39 | +import java.util.HashSet; |
| 40 | +import java.util.List; |
| 41 | +import java.util.Map; |
| 42 | +import java.util.Optional; |
| 43 | +import java.util.Set; |
37 | 44 | import java.util.stream.Stream;
|
38 | 45 |
|
39 | 46 | import org.assertj.core.api.SoftAssertions;
|
|
47 | 54 | import org.springframework.dao.DataIntegrityViolationException;
|
48 | 55 | import org.springframework.dao.IncorrectResultSizeDataAccessException;
|
49 | 56 | import org.springframework.dao.InvalidDataAccessApiUsageException;
|
50 |
| -import org.springframework.data.domain.*; |
| 57 | +import org.springframework.data.domain.Example; |
| 58 | +import org.springframework.data.domain.ExampleMatcher; |
| 59 | +import org.springframework.data.domain.Page; |
| 60 | +import org.springframework.data.domain.PageImpl; |
| 61 | +import org.springframework.data.domain.PageRequest; |
| 62 | +import org.springframework.data.domain.Pageable; |
| 63 | +import org.springframework.data.domain.Slice; |
| 64 | +import org.springframework.data.domain.Sort; |
51 | 65 | import org.springframework.data.domain.Sort.Direction;
|
52 | 66 | import org.springframework.data.domain.Sort.Order;
|
53 | 67 | import org.springframework.data.jpa.domain.Specification;
|
@@ -594,6 +608,16 @@ void returnsSamePageIfNoSpecGiven() {
|
594 | 608 | assertThat(repository.findAll((Specification<User>) null, pageable)).isEqualTo(repository.findAll(pageable));
|
595 | 609 | }
|
596 | 610 |
|
| 611 | + @Test // GH-2796 |
| 612 | + void removesAllIfSpecificationIsNull() { |
| 613 | + |
| 614 | + flushTestUsers(); |
| 615 | + |
| 616 | + repository.delete((Specification<User>) null); |
| 617 | + |
| 618 | + assertThat(repository.count()).isEqualTo(0L); |
| 619 | + } |
| 620 | + |
597 | 621 | @Test
|
598 | 622 | void returnsAllAsPageIfNoPageableIsGiven() {
|
599 | 623 |
|
|
0 commit comments