From d4d6be193093c3f1062236b427af4a3f8a483357 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Tue, 20 Apr 2021 12:23:40 +0200 Subject: [PATCH] Fix controller test --- src/test/java/app/controllers/EditorControllerTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/java/app/controllers/EditorControllerTest.java b/src/test/java/app/controllers/EditorControllerTest.java index 7fae56f..48caa2e 100644 --- a/src/test/java/app/controllers/EditorControllerTest.java +++ b/src/test/java/app/controllers/EditorControllerTest.java @@ -90,12 +90,13 @@ public class EditorControllerTest extends FxTestTemplate { String filePath = getClass().getResource(resourcePath).getPath(); File file = new File(filePath); - eventBus.post(new FileSelectedEvent(file.toPath())); try (MockedStatic mocked = mockStatic(FileOperations.class)) { mocked.when(() -> FileOperations.readFile(any())) .thenReturn(""); - mocked.verify(() -> FileOperations.readFile(file.toPath())); + eventBus.post(new FileSelectedEvent(file.toPath())); + + mocked.verify(() -> FileOperations.readFile(any())); } }