@@ -21,13 +21,13 @@ import static org.springframework.data.jpa.domain.Specification.*;
|
||||
import static org.springframework.data.jpa.domain.Specification.not;
|
||||
import static org.springframework.util.SerializationUtils.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import jakarta.persistence.criteria.CriteriaBuilder;
|
||||
import jakarta.persistence.criteria.CriteriaQuery;
|
||||
import jakarta.persistence.criteria.Predicate;
|
||||
import jakarta.persistence.criteria.Root;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
@@ -119,7 +119,7 @@ class SpecificationUnitTests implements Serializable {
|
||||
assertThat(specification.toPredicate(root, query, builder)).isEqualTo(predicate);
|
||||
}
|
||||
|
||||
@Test // DATAJPA-1651
|
||||
@Test // GH-1943
|
||||
public void allOfConcatenatesNull() {
|
||||
|
||||
Specification<Object> specification = Specification.allOf(null, spec, null);
|
||||
@@ -128,7 +128,7 @@ class SpecificationUnitTests implements Serializable {
|
||||
assertThat(specification.toPredicate(root, query, builder)).isEqualTo(predicate);
|
||||
}
|
||||
|
||||
@Test // DATAJPA-1651
|
||||
@Test // GH-1943
|
||||
public void anyOfConcatenatesNull() {
|
||||
|
||||
Specification<Object> specification = Specification.anyOf(null, spec, null);
|
||||
@@ -137,7 +137,7 @@ class SpecificationUnitTests implements Serializable {
|
||||
assertThat(specification.toPredicate(root, query, builder)).isEqualTo(predicate);
|
||||
}
|
||||
|
||||
@Test // DATAJPA-1651
|
||||
@Test // GH-1943
|
||||
public void emptyAllOfReturnsEmptySpecification() {
|
||||
|
||||
Specification<Object> specification = Specification.allOf();
|
||||
@@ -146,7 +146,7 @@ class SpecificationUnitTests implements Serializable {
|
||||
assertThat(specification.toPredicate(root, query, builder)).isNull();
|
||||
}
|
||||
|
||||
@Test // DATAJPA-1651
|
||||
@Test // GH-1943
|
||||
public void emptyAnyOfReturnsEmptySpecification() {
|
||||
|
||||
Specification<Object> specification = Specification.anyOf();
|
||||
|
||||
@@ -490,7 +490,7 @@ public class UserRepositoryTests {
|
||||
.isThrownBy(() -> repository.findOne(userHasFirstnameLike("e")));
|
||||
}
|
||||
|
||||
@Test // DATAJPA-1651
|
||||
@Test // GH-1943
|
||||
void executesCombinedSpecificationsCorrectly() {
|
||||
|
||||
flushTestUsers();
|
||||
@@ -516,7 +516,7 @@ public class UserRepositoryTests {
|
||||
assertThat(repository.findAll(spec)).containsOnly(secondUser);
|
||||
}
|
||||
|
||||
@Test // DATAJPA-1651
|
||||
@Test // GH-1943
|
||||
void executesCombinedSpecificationsWithPageableCorrectly() {
|
||||
|
||||
flushTestUsers();
|
||||
@@ -623,14 +623,14 @@ public class UserRepositoryTests {
|
||||
assertThat(repository.count()).isEqualTo(3L);
|
||||
}
|
||||
|
||||
@Test // DATAJPA-1651
|
||||
@Test
|
||||
void executesPagedSpecificationsCorrectly() {
|
||||
|
||||
Page<User> result = executeSpecWithSort(Sort.unsorted());
|
||||
assertThat(result.getContent()).isSubsetOf(firstUser, thirdUser);
|
||||
}
|
||||
|
||||
@Test // DATAJPA-1651
|
||||
@Test
|
||||
void executesPagedSpecificationsWithSortCorrectly() {
|
||||
|
||||
Page<User> result = executeSpecWithSort(Sort.by(Direction.ASC, "lastname"));
|
||||
@@ -638,7 +638,7 @@ public class UserRepositoryTests {
|
||||
assertThat(result.getContent()).contains(firstUser).doesNotContain(secondUser, thirdUser);
|
||||
}
|
||||
|
||||
@Test // DATAJPA-1651
|
||||
@Test
|
||||
void executesPagedSpecificationWithSortCorrectly2() {
|
||||
|
||||
Page<User> result = executeSpecWithSort(Sort.by(Direction.DESC, "lastname"));
|
||||
|
||||
Reference in New Issue
Block a user