44import com .intellij .codeInsight .daemon .impl .HighlightInfo ;
55import com .intellij .codeInsight .intention .IntentionAction ;
66import com .intellij .codeInspection .actions .CleanupInspectionIntention ;
7- import com .intellij .pom .java .LanguageLevel ;
87import com .intellij .psi .PsiElement ;
98import com .intellij .psi .PsiMethodCallExpression ;
109import com .intellij .psi .util .PsiTreeUtil ;
1110import com .intellij .refactoring .typeMigration .TypeMigrationBundle ;
1211import com .intellij .refactoring .typeMigration .inspections .GuavaInspection ;
1312import com .intellij .testFramework .IdeaTestUtil ;
13+ import com .intellij .testFramework .LightProjectDescriptor ;
1414import com .intellij .testFramework .PlatformTestUtil ;
15- import com .intellij .testFramework .builders . JavaModuleFixtureBuilder ;
16- import com .intellij .testFramework .fixtures .JavaCodeInsightFixtureTestCase ;
15+ import com .intellij .testFramework .fixtures . DefaultLightProjectDescriptor ;
16+ import com .intellij .testFramework .fixtures .LightJavaCodeInsightFixtureTestCase ;
1717import org .jetbrains .annotations .NotNull ;
1818
1919import java .util .Arrays ;
20+ import java .util .List ;
2021
2122/**
2223 * @author Dmitry Batkovich
2324 */
24- public class GuavaInspectionTest extends JavaCodeInsightFixtureTestCase {
25+ public class GuavaInspectionTest extends LightJavaCodeInsightFixtureTestCase {
26+ private static final LightProjectDescriptor DESCRIPTOR =
27+ new DefaultLightProjectDescriptor (IdeaTestUtil ::getMockJdk18 , List .of ("com.google.guava:guava:20.0" ));
28+
2529 private GuavaInspection myInspection ;
2630
2731 @ Override
@@ -32,15 +36,13 @@ public void setUp() throws Exception {
3236 }
3337
3438 @ Override
35- protected String getTestDataPath () {
36- return PlatformTestUtil . getCommunityPath () + "/java/typeMigration/testData/inspections/guava" ;
39+ protected @ NotNull LightProjectDescriptor getProjectDescriptor () {
40+ return DESCRIPTOR ;
3741 }
3842
3943 @ Override
40- protected void tuneFixture (JavaModuleFixtureBuilder moduleBuilder ) {
41- moduleBuilder .setLanguageLevel (LanguageLevel .JDK_1_8 );
42- moduleBuilder .addLibraryJars ("guava" , getTestDataPath () + "/" , "guava-stubs.jar" );
43- moduleBuilder .addJdk (IdeaTestUtil .getMockJdk18Path ().getPath ());
44+ protected String getTestDataPath () {
45+ return PlatformTestUtil .getCommunityPath () + "/java/typeMigration/testData/inspections/guava" ;
4446 }
4547
4648 public void testOptional () {
0 commit comments