AssertJ uses 4 methods to test exceptions, that we could support in S5783 and S5778 (doc):
- catchThrowable
- catchThrowableOfType
- assertThatThrownBy
- assertThatExceptionOfType
- assertThatCode
assertThatCode(boomCode).isInstanceOf(Exception.class).hasMessageContaining("boom");
- contributes to
-
MMF-2016 [Java] Test code quality: AssertJ related rules
-
- Closed
-
- relates to
-
RSPEC-5778 Only one method invocation is expected when testing runtime exceptions
- Active
-
RSPEC-5783 Only one method invocation is expected when testing checked exceptions
- Active