From 9fb2a08303fa038cdc667cdcb6585e29d3302695 Mon Sep 17 00:00:00 2001 From: Tagir Valeev Date: Mon, 31 Jul 2023 09:25:06 +0200 Subject: [PATCH] [java-tests] IGQuickFixesTestCase: improve error reporting GitOrigin-RevId: 178fe6614ba0a1513399915ec7f9e1fbd9969272 --- .../testsrc/com/siyeh/ig/IGQuickFixesTestCase.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/IGQuickFixesTestCase.java b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/IGQuickFixesTestCase.java index 9f7935188bb1..56d13e4924a2 100644 --- a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/IGQuickFixesTestCase.java +++ b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/IGQuickFixesTestCase.java @@ -10,6 +10,7 @@ import com.intellij.testFramework.TestDataPath; import com.intellij.testFramework.builders.JavaModuleFixtureBuilder; import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase; import com.intellij.util.ArrayUtilRt; +import one.util.streamex.StreamEx; import org.intellij.lang.annotations.Language; import org.jetbrains.annotations.NotNull; @@ -90,6 +91,10 @@ public abstract class IGQuickFixesTestCase extends JavaCodeInsightFixtureTestCas protected void doTest(final String testName, final String hint) { myFixture.configureByFile(getRelativePath() + "/" + testName + ".java"); IntentionAction action = myFixture.getAvailableIntention(hint); + if (action == null) { + fail("No action '"+hint+"' found among "+ + StreamEx.of(myFixture.getAvailableIntentions()).map(IntentionAction::getText).joining(", ")); + } assertNotNull(action); Path previewPath = Path.of(myFixture.getTestDataPath(), getRelativePath(), testName + ".preview.java"); if (Files.exists(previewPath)) {