From dea3432a6da7f3c7ac46826b255f75dbf68e1c88 Mon Sep 17 00:00:00 2001 From: Anyul Rivas Date: Thu, 14 Mar 2024 09:21:59 +0100 Subject: [PATCH] test: simplify code --- .../samples/petclinic/owner/OwnerControllerTests.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/test/java/org/springframework/samples/petclinic/owner/OwnerControllerTests.java b/src/test/java/org/springframework/samples/petclinic/owner/OwnerControllerTests.java index 78b812371..5d7c0cfce 100644 --- a/src/test/java/org/springframework/samples/petclinic/owner/OwnerControllerTests.java +++ b/src/test/java/org/springframework/samples/petclinic/owner/OwnerControllerTests.java @@ -84,7 +84,7 @@ class OwnerControllerTests { george.addPet(max); max.setId(1); return george; - }; + } @BeforeEach void setup() { @@ -231,11 +231,8 @@ class OwnerControllerTests { @SuppressWarnings("unchecked") List pets = (List) item; Pet pet = pets.get(0); - if (pet.getVisits().isEmpty()) { - return false; - } - return true; - } + return !pet.getVisits().isEmpty(); + } @Override public void describeTo(Description description) {