diff --git a/java/typeMigration/BUILD.bazel b/java/typeMigration/BUILD.bazel index 1a91ad7a8198..3c11c24b72d6 100644 --- a/java/typeMigration/BUILD.bazel +++ b/java/typeMigration/BUILD.bazel @@ -55,6 +55,7 @@ jvm_library( "//platform/code-style-impl:codeStyle-impl", "//java/java-impl-refactorings:impl-refactorings", "//java/codeserver/highlighting", + "//platform/projectModel-api:projectModel", ] ) ### auto-generated section `build intellij.java.typeMigration` end diff --git a/java/typeMigration/intellij.java.typeMigration.iml b/java/typeMigration/intellij.java.typeMigration.iml index 58cb6d157cff..37ccb90557e3 100644 --- a/java/typeMigration/intellij.java.typeMigration.iml +++ b/java/typeMigration/intellij.java.typeMigration.iml @@ -26,5 +26,6 @@ + \ No newline at end of file diff --git a/java/typeMigration/test/com/intellij/codeInsight/inspections/GuavaInspectionTest.java b/java/typeMigration/test/com/intellij/codeInsight/inspections/GuavaInspectionTest.java index 3053349823f5..7de7ad134ad0 100644 --- a/java/typeMigration/test/com/intellij/codeInsight/inspections/GuavaInspectionTest.java +++ b/java/typeMigration/test/com/intellij/codeInsight/inspections/GuavaInspectionTest.java @@ -4,24 +4,28 @@ package com.intellij.codeInsight.inspections; import com.intellij.codeInsight.daemon.impl.HighlightInfo; import com.intellij.codeInsight.intention.IntentionAction; import com.intellij.codeInspection.actions.CleanupInspectionIntention; -import com.intellij.pom.java.LanguageLevel; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiMethodCallExpression; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.refactoring.typeMigration.TypeMigrationBundle; import com.intellij.refactoring.typeMigration.inspections.GuavaInspection; import com.intellij.testFramework.IdeaTestUtil; +import com.intellij.testFramework.LightProjectDescriptor; import com.intellij.testFramework.PlatformTestUtil; -import com.intellij.testFramework.builders.JavaModuleFixtureBuilder; -import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase; +import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor; +import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase; import org.jetbrains.annotations.NotNull; import java.util.Arrays; +import java.util.List; /** * @author Dmitry Batkovich */ -public class GuavaInspectionTest extends JavaCodeInsightFixtureTestCase { +public class GuavaInspectionTest extends LightJavaCodeInsightFixtureTestCase { + private static final LightProjectDescriptor DESCRIPTOR = + new DefaultLightProjectDescriptor(IdeaTestUtil::getMockJdk18, List.of("com.google.guava:guava:20.0")); + private GuavaInspection myInspection; @Override @@ -32,15 +36,13 @@ public class GuavaInspectionTest extends JavaCodeInsightFixtureTestCase { } @Override - protected String getTestDataPath() { - return PlatformTestUtil.getCommunityPath() + "/java/typeMigration/testData/inspections/guava"; + protected @NotNull LightProjectDescriptor getProjectDescriptor() { + return DESCRIPTOR; } @Override - protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) { - moduleBuilder.setLanguageLevel(LanguageLevel.JDK_1_8); - moduleBuilder.addLibraryJars("guava", getTestDataPath() + "/", "guava-stubs.jar"); - moduleBuilder.addJdk(IdeaTestUtil.getMockJdk18Path().getPath()); + protected String getTestDataPath() { + return PlatformTestUtil.getCommunityPath() + "/java/typeMigration/testData/inspections/guava"; } public void testOptional() { diff --git a/java/typeMigration/testData/inspections/guava/guava-stubs.jar b/java/typeMigration/testData/inspections/guava/guava-stubs.jar deleted file mode 100644 index f491693f6c9e..000000000000 Binary files a/java/typeMigration/testData/inspections/guava/guava-stubs.jar and /dev/null differ