void (@NonNls String @NotNull [] testFiles, @NotNull Class<? extends LocalInspectionTool> inspectionClass, @NonNls @NotNull String quickFixName, boolean applyFix, boolean available) { myFixture.enableInspections(inspectionClass); myFixture.configureByFiles(testFiles); myFixture.checkHighlighting(true, false, false); final List<IntentionAction> intentionActions = myFixture.filterAvailableIntentions(quickFixName); if (available) { if (intentionActions.isEmpty()) { throw new AssertionError("Quickfix \"" + quickFixName + "\" is not available. All quickfixes:\n"+myFixture.getAvailableIntentions()); } if (intentionActions.size() > 1) { throw new AssertionError("There are more than one quickfix with the name \"" + quickFixName + "\". All quickfixes:\n"+myFixture.getAvailableIntentions()); } if (applyFix) { myFixture.launchAction(intentionActions.get(0)); myFixture.checkResultByFile(graftBeforeExt(testFiles[0], "_after")); } } else { assertEmpty("Quick fix \"" + quickFixName + "\" should not be available", intentionActions); } }