void () { PsiClass psiClass = mySource.createClass("NotATest", NOT_A_TEST); assertNotNull(psiClass); JUnitConfiguration configuration = new JUnitConfiguration("notATest", myProject); configuration.setMainClass(psiClass); configuration.setModule(configuration.getValidModules().iterator().next()); checkConfigurationException("Class 'NotATest' is not a test", configuration); RunManagerImpl runManager = (RunManagerImpl)RunManager.getInstance(myProject); runManager.setTemporaryConfiguration(new RunnerAndConfigurationSettingsImpl(runManager, configuration, false)); rename(psiClass, "NotATest2"); JUnitConfiguration.Data data = configuration.getPersistentData(); assertEquals("NotATest2", data.getMainClassName()); data.METHOD_NAME = "test"; data.TEST_OBJECT = JUnitConfiguration.TEST_METHOD; checkConfigurationException("Class 'NotATest2' is not a test", configuration); rename(psiClass.findMethodsByName("test", false)[0], "test2"); assertEquals("NotATest2", data.getMainClassName()); assertEquals("test2", data.getMethodName()); }