From 016549a2b40d671b14f1bfa81d619850a547a5b1 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Wed, 12 Dec 2018 15:42:29 +0100 Subject: [PATCH] #440 - Use Specification directly instead of deprecated Specifications type. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We now use Specification directly instead of using Specifications.where(…). --- .../snippets/test/CustomerRepositoryIntegrationTest.java | 3 +-- .../jpa/showcase/after/CustomerRepositoryIntegrationTest.java | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/jpa/showcase/src/test-snippets/java/example/springdata/jpa/showcase/snippets/test/CustomerRepositoryIntegrationTest.java b/jpa/showcase/src/test-snippets/java/example/springdata/jpa/showcase/snippets/test/CustomerRepositoryIntegrationTest.java index 5a197bca..b82526e4 100644 --- a/jpa/showcase/src/test-snippets/java/example/springdata/jpa/showcase/snippets/test/CustomerRepositoryIntegrationTest.java +++ b/jpa/showcase/src/test-snippets/java/example/springdata/jpa/showcase/snippets/test/CustomerRepositoryIntegrationTest.java @@ -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 dave = repository.findById(1L); LocalDate expiryLimit = new LocalDate(2011, 3, 1); - List result = repository.findAll(where(accountExpiresBefore(expiryLimit))); + List result = repository.findAll(accountExpiresBefore(expiryLimit)); assertThat(result).hasSize(1); assertThat(dave).hasValueSatisfying(it -> assertThat(result).contains(it)); diff --git a/jpa/showcase/src/test/java/example/springdata/jpa/showcase/after/CustomerRepositoryIntegrationTest.java b/jpa/showcase/src/test/java/example/springdata/jpa/showcase/after/CustomerRepositoryIntegrationTest.java index fa08d022..660d26a4 100644 --- a/jpa/showcase/src/test/java/example/springdata/jpa/showcase/after/CustomerRepositoryIntegrationTest.java +++ b/jpa/showcase/src/test/java/example/springdata/jpa/showcase/after/CustomerRepositoryIntegrationTest.java @@ -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 dave = repository.findById(1L); LocalDate expiryLimit = new LocalDate(2011, 3, 1); - List result = repository.findAll(where(accountExpiresBefore(expiryLimit))); + List result = repository.findAll(accountExpiresBefore(expiryLimit)); assertThat(result).hasSize(1); assertThat(dave).hasValueSatisfying(it -> assertThat(result).contains(it));