Package org.assertj.core.api
Class ThrowableAssert
- java.lang.Object
-
- org.assertj.core.api.AbstractAssert<SELF,ACTUAL>
-
- org.assertj.core.api.AbstractObjectAssert<SELF,ACTUAL>
-
- org.assertj.core.api.AbstractThrowableAssert<ThrowableAssert,Throwable>
-
- org.assertj.core.api.ThrowableAssert
-
- All Implemented Interfaces:
Assert<ThrowableAssert,Throwable>,Descriptable<ThrowableAssert>,ExtensionPoints<ThrowableAssert,Throwable>
public class ThrowableAssert extends AbstractThrowableAssert<ThrowableAssert,Throwable>
Assertion methods forThrowables.To create a new instance of this class, invoke
.Assertions.assertThat(Throwable)- Author:
- David DIDIER, Alex Ruiz, Joel Costigliola, Mikhail Mazursky
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceThrowableAssert.ThrowingCallable
-
Field Summary
-
Fields inherited from class org.assertj.core.api.AbstractThrowableAssert
throwables
-
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, assertionErrorCreator, conditions, info, myself, objects, throwUnsupportedExceptionOnEquals
-
-
Constructor Summary
Constructors Constructor Description ThrowableAssert(Throwable actual)ThrowableAssert(Callable<V> runnable)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static <V> ThrowablebuildThrowableAssertFromCallable(Callable<V> callable)static ThrowablecatchThrowable(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)static <THROWABLE extends Throwable>
THROWABLEcatchThrowableOfType(ThrowableAssert.ThrowingCallable shouldRaiseThrowable, Class<THROWABLE> type)-
Methods inherited from class org.assertj.core.api.AbstractThrowableAssert
doesNotThrowAnyException, hasBeenThrown, hasCause, hasCauseExactlyInstanceOf, hasCauseInstanceOf, hasCauseReference, hasMessage, hasMessage, hasMessageContaining, hasMessageContainingAll, hasMessageEndingWith, hasMessageFindingMatch, hasMessageMatching, hasMessageNotContaining, hasMessageNotContainingAny, hasMessageStartingWith, hasNoCause, hasNoSuppressedExceptions, hasRootCause, hasRootCauseExactlyInstanceOf, hasRootCauseInstanceOf, hasStackTraceContaining, hasSuppressedException
-
Methods inherited from class org.assertj.core.api.AbstractObjectAssert
as, as, extracting, extracting, extracting, extracting, getComparatorsByType, hasAllNullFieldsOrProperties, hasAllNullFieldsOrPropertiesExcept, hasFieldOrProperty, hasFieldOrPropertyWithValue, hasNoNullFieldsOrProperties, hasNoNullFieldsOrPropertiesExcept, isEqualToComparingFieldByField, isEqualToComparingFieldByFieldRecursively, isEqualToComparingOnlyGivenFields, isEqualToIgnoringGivenFields, isEqualToIgnoringNullFields, newObjectAssert, returns, usingComparatorForFields, usingComparatorForType, usingRecursiveComparison, usingRecursiveComparison, withAssertionState, withComparatorByPropertyOrField, withTypeComparator
-
Methods inherited from class org.assertj.core.api.AbstractAssert
asInstanceOf, asList, asString, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, setCustomRepresentation, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, withFailMessage, withRepresentation, withThreadDumpOnError
-
-
-
-
Method Detail
-
buildThrowableAssertFromCallable
private static <V> Throwable buildThrowableAssertFromCallable(Callable<V> callable) throws AssertionError
- Throws:
AssertionError
-
catchThrowable
public static Throwable catchThrowable(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)
-
catchThrowableOfType
public static <THROWABLE extends Throwable> THROWABLE catchThrowableOfType(ThrowableAssert.ThrowingCallable shouldRaiseThrowable, Class<THROWABLE> type)
-
-