#440 - Use Specification directly instead of deprecated Specifications type.

We now use Specification directly instead of using Specifications.where(…).
This commit is contained in:
Mark Paluch
2018-12-12 15:42:29 +01:00
parent 4f64e5dc8b
commit 016549a2b4
2 changed files with 2 additions and 5 deletions

View File

@@ -17,7 +17,6 @@ package example.springdata.jpa.showcase.snippets.test;
import static example.springdata.jpa.showcase.snippets.CustomerSpecifications.*;
import static org.assertj.core.api.Assertions.*;
import static org.springframework.data.jpa.domain.Specifications.*;
import example.springdata.jpa.showcase.after.CustomerRepository;
import example.springdata.jpa.showcase.core.Customer;
@@ -42,7 +41,7 @@ public class CustomerRepositoryIntegrationTest {
Optional<Customer> dave = repository.findById(1L);
LocalDate expiryLimit = new LocalDate(2011, 3, 1);
List<Customer> result = repository.findAll(where(accountExpiresBefore(expiryLimit)));
List<Customer> result = repository.findAll(accountExpiresBefore(expiryLimit));
assertThat(result).hasSize(1);
assertThat(dave).hasValueSatisfying(it -> assertThat(result).contains(it));

View File

@@ -17,8 +17,6 @@ package example.springdata.jpa.showcase.after;
import static example.springdata.jpa.showcase.snippets.CustomerSpecifications.*;
import static org.assertj.core.api.Assertions.*;
import static org.springframework.data.jpa.domain.Specifications.*;
import example.springdata.jpa.showcase.AbstractShowcaseTest;
import example.springdata.jpa.showcase.core.Customer;
@@ -69,7 +67,7 @@ public class CustomerRepositoryIntegrationTest extends AbstractShowcaseTest {
Optional<Customer> dave = repository.findById(1L);
LocalDate expiryLimit = new LocalDate(2011, 3, 1);
List<Customer> result = repository.findAll(where(accountExpiresBefore(expiryLimit)));
List<Customer> result = repository.findAll(accountExpiresBefore(expiryLimit));
assertThat(result).hasSize(1);
assertThat(dave).hasValueSatisfying(it -> assertThat(result).contains(it));