diff --git a/plugins/junit/src/com/intellij/execution/junit/TestObject.java b/plugins/junit/src/com/intellij/execution/junit/TestObject.java index 15314a0338f0..d9dc3eb541de 100644 --- a/plugins/junit/src/com/intellij/execution/junit/TestObject.java +++ b/plugins/junit/src/com/intellij/execution/junit/TestObject.java @@ -201,12 +201,11 @@ public abstract class TestObject extends JavaTestFrameworkRunnableState psiFacade.findClass("org.junit.platform.commons.JUnitException", globalSearchScope)); + String launcherVersion = ObjectUtils.notNull(getVersion(classFromCommon), "1.0.0"); if (!hasPackageWithDirectories(psiFacade, "org.junit.platform.launcher", globalSearchScope)) { - - PsiClass classFromCommon = DumbService.getInstance(project).computeWithAlternativeResolveEnabled(() -> psiFacade.findClass("org.junit.platform.commons.JUnitException", globalSearchScope)); - String version = ObjectUtils.notNull(getVersion(classFromCommon), "1.0.0"); downloadDependenciesWhenRequired(project, classPath, - new RepositoryLibraryProperties("org.junit.platform", "junit-platform-launcher", version)); + new RepositoryLibraryProperties("org.junit.platform", "junit-platform-launcher", launcherVersion)); } //add standard engines only if no engine api is present @@ -222,7 +221,7 @@ public abstract class TestObject extends JavaTestFrameworkRunnableState