Open
Description
What happened?
If the returned Throwable of Junit's assertThrows
is used for further checks, the build breaks when the "Prefer AssertJ" conversion is applied. This is because AssertJ's assertThatThrownBy
does not return a Throwable.
Example from a PR:
- Throwable throwed = assertThrows(() -> foo());
- assertThat(throwed.getMessage()).contains("My error msg");
+ Throwable throwed = assertThatThrownBy(() -> foo()); // This breaks
+ assertThat(throwed.getMessage()).contains("My error msg");
Metadata
Metadata
Assignees
Labels
No labels