code cleanup
This commit is contained in:
parent
d686469336
commit
4e15a706fb
|
@ -21,7 +21,6 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
|
|
||||||
class PlantListModelTest {
|
class PlantListModelTest {
|
||||||
PlantDatabase plantDatabase;
|
PlantDatabase plantDatabase;
|
||||||
List<Plant> examplePlantList;
|
List<Plant> examplePlantList;
|
||||||
|
@ -130,12 +129,7 @@ class PlantListModelTest {
|
||||||
@Test
|
@Test
|
||||||
void getFilteredPlantList() throws HardinessZoneNotSetException, IOException {
|
void getFilteredPlantList() throws HardinessZoneNotSetException, IOException {
|
||||||
model.setCurrentZone(HardinessZone.ZONE_1A);
|
model.setCurrentZone(HardinessZone.ZONE_1A);
|
||||||
Predicate<Plant> predicate = new Predicate<Plant>() {
|
Predicate<Plant> predicate = plant -> plant.name().toUpperCase(Locale.ROOT).contains("E");
|
||||||
@Override
|
|
||||||
public boolean test(Plant plant) {
|
|
||||||
return plant.name().toUpperCase(Locale.ROOT).contains("E");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
List<Plant> plantListResult = model.getFilteredPlantList(HardinessZone.ZONE_8A, predicate);
|
List<Plant> plantListResult = model.getFilteredPlantList(HardinessZone.ZONE_8A, predicate);
|
||||||
checkCurrentZone(HardinessZone.ZONE_8A);
|
checkCurrentZone(HardinessZone.ZONE_8A);
|
||||||
assertEquals(2, plantListResult.size());
|
assertEquals(2, plantListResult.size());
|
||||||
|
@ -152,4 +146,4 @@ class PlantListModelTest {
|
||||||
assertEquals(1, plantListResult.size());
|
assertEquals(1, plantListResult.size());
|
||||||
assertEquals(examplePlantList.get(0), plantListResult.get(0));
|
assertEquals(examplePlantList.get(0), plantListResult.get(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue