Skip to content

Commit 64ef5aa

Browse files
committed
trycatch i hellomodeltest startup
1 parent 8f79299 commit 64ef5aa

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/test/java/com/example/HelloModelTest.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,13 @@ class HelloModelTest {
1919

2020
@BeforeAll
2121
static void setupJavaFX() {
22-
if (!Platform.isFxApplicationThread()) {
23-
Platform.startup(() -> {});
22+
try {
23+
if (!Platform.isFxApplicationThread()) {
24+
Platform.startup(() -> {});
25+
}
26+
} catch (UnsupportedOperationException e) {
27+
System.out.println("Headless environment detected – skipping JavaFX startup");
28+
} catch (IllegalStateException e) {
2429
}
2530
}
2631

0 commit comments

Comments
 (0)