From 4e15a706fb035f43c41453099b1676ed8cc1e7ce Mon Sep 17 00:00:00 2001 From: schrom01 Date: Mon, 24 Oct 2022 21:34:19 +0200 Subject: [PATCH] code cleanup --- .../gartenverwaltung/plantList/PlantListModelTest.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/test/java/ch/zhaw/gartenverwaltung/plantList/PlantListModelTest.java b/src/test/java/ch/zhaw/gartenverwaltung/plantList/PlantListModelTest.java index fbf6417..0aecc35 100644 --- a/src/test/java/ch/zhaw/gartenverwaltung/plantList/PlantListModelTest.java +++ b/src/test/java/ch/zhaw/gartenverwaltung/plantList/PlantListModelTest.java @@ -21,7 +21,6 @@ import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; - class PlantListModelTest { PlantDatabase plantDatabase; List examplePlantList; @@ -130,12 +129,7 @@ class PlantListModelTest { @Test void getFilteredPlantList() throws HardinessZoneNotSetException, IOException { model.setCurrentZone(HardinessZone.ZONE_1A); - Predicate predicate = new Predicate() { - @Override - public boolean test(Plant plant) { - return plant.name().toUpperCase(Locale.ROOT).contains("E"); - } - }; + Predicate predicate = plant -> plant.name().toUpperCase(Locale.ROOT).contains("E"); List plantListResult = model.getFilteredPlantList(HardinessZone.ZONE_8A, predicate); checkCurrentZone(HardinessZone.ZONE_8A); assertEquals(2, plantListResult.size()); @@ -152,4 +146,4 @@ class PlantListModelTest { assertEquals(1, plantListResult.size()); assertEquals(examplePlantList.get(0), plantListResult.get(0)); } -} \ No newline at end of file +}