[jvm] Disable assertions between inconvertible types on throwables

#IDEA-331109

GitOrigin-RevId: b7f9a705ae3cce08880316d7d7a2ff0a92668bf9
This commit is contained in:
Bart van Helvert
2023-10-03 12:16:20 +02:00
committed by intellij-monorepo-bot
parent 2c7dcce36f
commit 212683a78c
2 changed files with 31 additions and 6 deletions

View File

@@ -318,4 +318,19 @@ class JavaAssertEqualsBetweenInconvertibleTypesInspectionTest : AssertEqualsBetw
}
""".trimIndent())
}
fun `test Assertj cause match`() {
myFixture.testHighlighting(JvmLanguage.JAVA, """
import org.assertj.core.api.Assertions;
class MyTest {
@org.junit.jupiter.api.Test
void testExtractingNoHighlight() {
NullPointerException cause = new NullPointerException();
IllegalArgumentException e = new IllegalArgumentException(cause);
Assertions.assertThat(e).cause().isSameAs(cause);
}
}
""".trimIndent())
}
}