Refaster rules related to AssertJ assertions over expressions that may throw a Throwable subtype
Apache 2.0For reasons of consistency we prefer org.assertj.core.api.Assertions#assertThatThrownBy over static methods for specific exception
types. Note that only the most common assertion expressions are rewritten here; covering all
cases would require the implementation of an Error Prone check instead.
Source.
tech. picnic. errorprone. refasterrules. AssertJThrowingCallableRulesRecipesmod run . --recipe= tech. picnic. errorprone. refasterrules. AssertJThrowingCallableRulesRecipesInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.
Recipe list
It runs these recipes, in this order.
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOf - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfIllegalArgumentExceptionClass - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfIllegalArgumentExceptionClassHasMessage - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfIllegalArgumentExceptionClassRootCauseHasMessage - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfIllegalArgumentExceptionClassHasMessageVarargs - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfIllegalArgumentExceptionClassHasMessageStartingWith - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfIllegalArgumentExceptionClassHasMessageContaining - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfIllegalArgumentExceptionClassHasMessageNotContainingAny - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfIllegalStateExceptionClass - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfIllegalStateExceptionClassHasMessage - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfIllegalStateExceptionClassRootCauseHasMessage - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfIllegalStateExceptionClassHasMessageVarargs - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfIllegalStateExceptionClassHasMessageStartingWith - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfIllegalStateExceptionClassHasMessageContaining - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfIllegalStateExceptionClassHasMessageNotContaining - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfNullPointerExceptionClass - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfNullPointerExceptionClassHasMessage - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfNullPointerExceptionClassRootCauseHasMessage - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfNullPointerExceptionClassHasMessageVarargs - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfNullPointerExceptionClassHasMessageStartingWith - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfNullPointerExceptionClassHasMessageContaining - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfNullPointerExceptionClassHasMessageNotContaining - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfIOExceptionClass - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfIOExceptionClassHasMessage - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfIOExceptionClassRootCauseHasMessage - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfIOExceptionClassHasMessageVarargs - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfIOExceptionClassHasMessageStartingWith - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfIOExceptionClassHasMessageContaining - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfIOExceptionClassHasMessageNotContaining - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByAsInstanceOfThrowable - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfHasMessage - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfRootCauseHasMessage - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfHasMessageVarargs - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfHasMessageStartingWith - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfHasMessageContaining - Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOfHasMessageNotContaining - Refaster template
AssertJThrowingCallableRules.AbstractThrowableAssertHasMessage - Refaster template
AssertJThrowingCallableRules.AbstractThrowableAssertWithFailMessage - Refaster template
AssertJThrowingCallableRules.AbstractThrowableAssertCauseIsSameAs