-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.8.0 RV_EXCEPTION_NOT_THROWN False positive with JUnit 5 assertThrows #2628
Comments
Can you please provide the |
The method signature is:
|
This is flagging just about all of our JUnit tests for exception behavior. It shows up with both |
As an additional note, I changed one of the tests to use the AssertJ method |
I think I have a bit more information here. Assertions.assertThrows(NullPointerException.class, () -> methodThrowingNpe(null)); but the following code does not: var npe = Assertions.assertThrows(NullPointerException.class, () -> methodThrowingNpe(null));
Assertions.assertTrue(npe.getMessage().contains("something")); |
RV | org.junit.jupiter.api.Assertions.assertThrows(Class, Executable) not thrown in com.my.package.SomeServiceTest$someNestedTest.itShouldDoSomething()
Called method org.junit.jupiter.api.Assertions.assertThrows(Class, Executable)
At SomeServiceTest.java:[line 85]
Where line 85 is:
The text was updated successfully, but these errors were encountered: