String () { Project project = myConfiguration.getProject(); LOG.assertTrue(!DumbService.getInstance(project).isAlternativeResolveEnabled()); final GlobalSearchScope globalSearchScope = getScopeForJUnit(myConfiguration); JUnitConfiguration.Data data = myConfiguration.getPersistentData(); if (JUnitConfiguration.TEST_CATEGORY.equals(data.TEST_OBJECT)) { return JUnitStarter.JUNIT4_PARAMETER; } if (JUnitConfiguration.TEST_TAGS.equals(data.TEST_OBJECT)) { return JUnitStarter.JUNIT5_PARAMETER; } boolean isMethodConfiguration = JUnitConfiguration.TEST_METHOD.equals(data.TEST_OBJECT); boolean isClassConfiguration = JUnitConfiguration.TEST_CLASS.equals(data.TEST_OBJECT); final PsiClass psiClass = isMethodConfiguration || isClassConfiguration ? JavaExecutionUtil.findMainClass(project, data.getMainClassName(), globalSearchScope) : null; if (psiClass != null) { Set<TestFramework> testFrameworks = TestFrameworks.detectApplicableFrameworks(psiClass); TestFramework testFramework = ContainerUtil.getFirstItem(testFrameworks); if (testFramework instanceof JUnit5Framework || testFrameworks.size() > 1 && ContainerUtil.find(testFrameworks, f -> f instanceof JUnit5Framework) != null) { return JUnitStarter.JUNIT5_PARAMETER; } if (testFramework instanceof JUnit4Framework) { return JUnitStarter.JUNIT4_PARAMETER; } if (testFramework instanceof JUnit3Framework) { return isClassConfiguration ? JUnitStarter.JUNIT4_PARAMETER : JUnitStarter.JUNIT3_PARAMETER; } if (testFramework instanceof JUnitTestFramework && !((JUnitTestFramework)testFramework).shouldRunSingleClassAsJUnit5(project, globalSearchScope)) { return JUnitStarter.JUNIT4_PARAMETER; } } return JUnitUtil.isJUnit5(globalSearchScope, project) || isCustomJUnit5(globalSearchScope) ? JUnitStarter.JUNIT5_PARAMETER : DEFAULT_RUNNER; }