void (DataContext dataContext, RenameDialog dialog) { if (ApplicationManager.getApplication().isUnitTestMode()) { final String name = PsiElementRenameHandler.DEFAULT_NAME.getData(dataContext); dialog.performRename(name); dialog.close(OK_EXIT_CODE); } else { dialog.show(); } }