VirtualFile (final String relativeVfsPath) { return WriteCommandAction.runWriteCommandAction(null, (Computable<VirtualFile>)() -> { final String path = TEST_PATH + File.separatorChar + getTestName(true) + File.separatorChar + relativeVfsPath.replace('/', File.separatorChar); final VirtualFile result = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(path)); assertNotNull("File " + path + " doesn't exist", result); return result; }); }