From 56020a7529a5064010cdac6224bdc96fedb2cf03 Mon Sep 17 00:00:00 2001 From: Elias Csomor Date: Fri, 9 Dec 2022 17:35:41 +0100 Subject: [PATCH] Setup Platform for runLater in GardenSchedule Otherwise Test planTaskForCrop crashes due to unitialized Platform --- .../gartenverwaltung/models/GardenScheduleTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/test/java/ch/zhaw/gartenverwaltung/models/GardenScheduleTest.java b/src/test/java/ch/zhaw/gartenverwaltung/models/GardenScheduleTest.java index 8bce1be..4f45242 100644 --- a/src/test/java/ch/zhaw/gartenverwaltung/models/GardenScheduleTest.java +++ b/src/test/java/ch/zhaw/gartenverwaltung/models/GardenScheduleTest.java @@ -3,6 +3,9 @@ package ch.zhaw.gartenverwaltung.models; import ch.zhaw.gartenverwaltung.io.*; import ch.zhaw.gartenverwaltung.models.GardenSchedule; import ch.zhaw.gartenverwaltung.types.*; +import javafx.application.Platform; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -29,6 +32,16 @@ class GardenScheduleTest { List exampleTaskTemplateList; GardenSchedule model; + @BeforeAll + static void setUpAll() { + Platform.startup(()->{}); + } + + @AfterAll + static void tearDownAll() { + Platform.exit(); + } + @BeforeEach void setUp() throws IOException, HardinessZoneNotSetException { createExampleTaskList();