PsiClass (String newName, String className) { if (className == null) { className = getTestName(false); myFixture.configureByFiles(getTestName(true) + ".fxml", getTestName(false) + ".java"); } else { myFixture.configureByFiles(getTestName(true) + ".fxml", getTestName(false) + ".java", className.replace('.', '/') + ".java"); } final MapDataContext dataContext = new MapDataContext(); dataContext.put(CommonDataKeys.EDITOR, getEditor()); dataContext.put(PsiElementRenameHandler.DEFAULT_NAME, newName); final JavaFxPropertyRenameHandler renameHandler = new JavaFxPropertyRenameHandler(); assertTrue(renameHandler.isAvailableOnDataContext(dataContext)); renameHandler.invoke(getProject(), getEditor(), null, dataContext); myFixture.checkResultByFile(getTestName(true) + "_after.fxml"); final PsiClass psiClass = myFixture.findClass(className); assertNotNull(psiClass); return psiClass; }