continue GardenPlan tests
This commit is contained in:
parent
5411ac69ae
commit
82eab6d5cd
|
@ -75,8 +75,6 @@ public class JsonGardenPlanTest {
|
|||
@Test
|
||||
@DisplayName("Add new Crop.")
|
||||
void addNewCrop() {
|
||||
|
||||
|
||||
Crop crop = new Crop(2l, LocalDate.parse("22.02.2023", formatter));
|
||||
try {
|
||||
testDatabase.saveCrop(crop);
|
||||
|
@ -89,13 +87,23 @@ public class JsonGardenPlanTest {
|
|||
}
|
||||
assertTrue(testCrop.isPresent());
|
||||
Assertions.assertEquals(2l, testCrop.get().getPlantId());
|
||||
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
@DisplayName("Remove crop")
|
||||
void removeCrop(){
|
||||
try {
|
||||
Optional<Crop> crop = testDatabase.getCropById(2l);
|
||||
Assertions.assertTrue(crop.isPresent());
|
||||
testDatabase.removeCrop(crop.get());
|
||||
crop = testDatabase.getCropById(2l);
|
||||
Assertions.assertFalse(crop.isPresent());
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue