Search in sources :

Example 1 with StaticPseudoFunctionalStyleMethodInspection

use of com.intellij.codeInspection.java18StreamApi.StaticPseudoFunctionalStyleMethodInspection in project intellij-community by JetBrains.

the class StaticPseudoFunctionalStyleMethodTest method doTest.

private void doTest() {
    myFixture.configureByFile(getTestName(true) + "/test.java");
    myFixture.enableInspections(new StaticPseudoFunctionalStyleMethodInspection());
    boolean isQuickFixFound = false;
    for (IntentionAction action : myFixture.getAvailableIntentions()) {
        if (action instanceof QuickFixWrapper) {
            final LocalQuickFix fix = ((QuickFixWrapper) action).getFix();
            if (fix instanceof StaticPseudoFunctionalStyleMethodInspection.ReplacePseudoLambdaWithLambda) {
                myFixture.launchAction(action);
                isQuickFixFound = true;
                break;
            }
        }
    }
    assertTrue("Quick fix isn't found", isQuickFixFound);
    myFixture.checkResultByFile(getTestName(true) + "/test_after.java");
}
Also used : StaticPseudoFunctionalStyleMethodInspection(com.intellij.codeInspection.java18StreamApi.StaticPseudoFunctionalStyleMethodInspection) IntentionAction(com.intellij.codeInsight.intention.IntentionAction) QuickFixWrapper(com.intellij.codeInspection.ex.QuickFixWrapper)

Aggregations

IntentionAction (com.intellij.codeInsight.intention.IntentionAction)1 QuickFixWrapper (com.intellij.codeInspection.ex.QuickFixWrapper)1 StaticPseudoFunctionalStyleMethodInspection (com.intellij.codeInspection.java18StreamApi.StaticPseudoFunctionalStyleMethodInspection)1