void (@NotNull Project project, @NotNull TestDiscoveryProducer.PsiTestProcessor processor, @NotNull List<Couple<String>> classesAndMethods, @NotNull List<String> filePaths) { GlobalSearchScope scope = GlobalSearchScope.projectScope(project); for (TestDiscoveryConfigurationProducer producer : getRunConfigurationProducers(project)) { byte frameworkId = ((JavaTestConfigurationWithDiscoverySupport)producer.getConfigurationFactory().createTemplateConfiguration(project)) .getTestFrameworkId(); TestDiscoveryProducer.consumeDiscoveredTests(project, classesAndMethods, frameworkId, filePaths, (testClass, testMethod, parameter) -> { PsiClass[] testClassPsi = {null}; PsiMethod[] testMethodPsi = {null}; ReadAction.run(() -> DumbService.getInstance(project).runWithAlternativeResolveEnabled(() -> { testClassPsi[0] = ClassUtil.findPsiClass(PsiManager.getInstance(project), testClass, null, true, scope); boolean checkBases = parameter != null; // check bases for parameterized tests if (testClassPsi[0] != null) { testMethodPsi[0] = ArrayUtil.getFirstElement(testClassPsi[0].findMethodsByName(testMethod, checkBases)); } })); if (testClassPsi[0] != null) { if (!processor.process(testClassPsi[0], testMethodPsi[0], parameter)) return false; } return true; }); } }