From ddd3591e0b11a0d04c469e1c5271b0c43d0228cb Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Wed, 13 Mar 2019 23:10:59 +0530 Subject: [PATCH] BAEL-13321 Fixed test-data creation logic in live test --- .../com/baeldung/projection/SpringDataProjectionLiveTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-data-rest/src/test/java/com/baeldung/projection/SpringDataProjectionLiveTest.java b/spring-data-rest/src/test/java/com/baeldung/projection/SpringDataProjectionLiveTest.java index ad219ccd53..274ae3bc1d 100644 --- a/spring-data-rest/src/test/java/com/baeldung/projection/SpringDataProjectionLiveTest.java +++ b/spring-data-rest/src/test/java/com/baeldung/projection/SpringDataProjectionLiveTest.java @@ -37,7 +37,7 @@ public class SpringDataProjectionLiveTest { @Before public void setup() { - if (bookRepo.findById(1L) == null) { + if (!bookRepo.findById(1L).isPresent()) { Book book = new Book("Animal Farm"); book.setIsbn("978-1943138425"); book = bookRepo.save(book);