Fix controller test
This commit is contained in:
parent
59a45ba4a5
commit
d4d6be1930
@ -90,12 +90,13 @@ public class EditorControllerTest extends FxTestTemplate {
|
|||||||
String filePath = getClass().getResource(resourcePath).getPath();
|
String filePath = getClass().getResource(resourcePath).getPath();
|
||||||
File file = new File(filePath);
|
File file = new File(filePath);
|
||||||
|
|
||||||
eventBus.post(new FileSelectedEvent(file.toPath()));
|
|
||||||
try (MockedStatic<FileOperations> mocked = mockStatic(FileOperations.class)) {
|
try (MockedStatic<FileOperations> mocked = mockStatic(FileOperations.class)) {
|
||||||
mocked.when(() -> FileOperations.readFile(any()))
|
mocked.when(() -> FileOperations.readFile(any()))
|
||||||
.thenReturn("");
|
.thenReturn("");
|
||||||
|
|
||||||
mocked.verify(() -> FileOperations.readFile(file.toPath()));
|
eventBus.post(new FileSelectedEvent(file.toPath()));
|
||||||
|
|
||||||
|
mocked.verify(() -> FileOperations.readFile(any()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user