mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[devkit] RetrievingServiceInspection: fix tests
IJ-CR-102194 GitOrigin-RevId: b34950f81f00f95e966da6f299e05c255a4785f1
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5a8799ac08
commit
c27a5fdc2f
-1
@@ -8,7 +8,6 @@ final class MyService {
|
||||
}
|
||||
|
||||
void foo() {
|
||||
System.out.println(42);
|
||||
MyService service = <weak_warning descr="Can be replaced with 'MyService.getInstance()' call">ApplicationManager.getApplication().getService<caret>(MyService.class)</weak_warning>;
|
||||
}
|
||||
}
|
||||
-1
@@ -8,7 +8,6 @@ final class MyService {
|
||||
}
|
||||
|
||||
void foo() {
|
||||
System.out.println(42);
|
||||
MyService service = MyService.getInstance();
|
||||
}
|
||||
}
|
||||
-1
@@ -9,7 +9,6 @@ final class MyService {
|
||||
}
|
||||
|
||||
void foo(Project project) {
|
||||
System.out.println(42);
|
||||
MyService service = <weak_warning descr="Can be replaced with 'MyService.getInstance()' call">project.getService<caret>(MyService.class)</weak_warning>;
|
||||
}
|
||||
}
|
||||
-1
@@ -9,7 +9,6 @@ final class MyService {
|
||||
}
|
||||
|
||||
void foo(Project project) {
|
||||
System.out.println(42);
|
||||
MyService service = MyService.getInstance(project);
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -2,6 +2,7 @@
|
||||
package org.jetbrains.idea.devkit.inspections
|
||||
|
||||
import com.intellij.testFramework.TestDataPath
|
||||
import org.jetbrains.idea.devkit.DevKitBundle
|
||||
import org.jetbrains.idea.devkit.DevkitJavaTestsUtil
|
||||
import org.jetbrains.idea.devkit.inspections.quickfix.RetrievingServiceInspectionTestBase
|
||||
|
||||
@@ -21,10 +22,10 @@ internal class RetrievingServiceInspectionTest : RetrievingServiceInspectionTest
|
||||
}
|
||||
|
||||
fun testReplaceWithGetInstanceApplicationLevel() {
|
||||
doTest()
|
||||
doTest(DevKitBundle.message("inspection.retrieving.service.replace.with", "MyService", "getInstance"))
|
||||
}
|
||||
|
||||
fun testReplaceWithGetInstanceProjectLevel() {
|
||||
doTest()
|
||||
doTest(DevKitBundle.message("inspection.retrieving.service.replace.with", "MyService", "getInstance"))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user