fixed removeTasksForCrop

This commit is contained in:
Elias Csomor 2022-11-21 10:07:43 +01:00
parent 11a1a63345
commit 6dea42dd1f
2 changed files with 7 additions and 1 deletions

View File

@ -87,6 +87,13 @@ public class JsonTaskList implements TaskList {
loadTaskListFromFile(); loadTaskListFromFile();
} }
taskMap.values().removeIf(task -> task.getCropId() == cropId); taskMap.values().removeIf(task -> task.getCropId() == cropId);
for (Task task :
taskMap.values()) {
if (task.getCropId() == cropId) {
taskMap.remove(task);
}
}
writeTaskListToFile();
} }
/** /**

View File

@ -47,7 +47,6 @@ public class JsonTaskListTest {
} }
@Disabled("disabled until adding works.")
@Test @Test
@DisplayName("Add task.") @DisplayName("Add task.")
void addTask() { void addTask() {