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,java.lang.Throwable>
-
- org.assertj.core.api.ThrowableAssert
-
- All Implemented Interfaces:
Assert<ThrowableAssert,java.lang.Throwable>,Descriptable<ThrowableAssert>,ExtensionPoints<ThrowableAssert,java.lang.Throwable>
public class ThrowableAssert extends AbstractThrowableAssert<ThrowableAssert,java.lang.Throwable>
Assertion methods forThrowables.To create a new instance of this class, invoke
.Assertions.assertThat(Throwable)
-
-
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(java.lang.Throwable actual)ThrowableAssert(java.util.concurrent.Callable<V> runnable)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static <V> java.lang.ThrowablebuildThrowableAssertFromCallable(java.util.concurrent.Callable<V> callable)static java.lang.ThrowablecatchThrowable(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)static <THROWABLE extends java.lang.Throwable>
THROWABLEcatchThrowableOfType(ThrowableAssert.ThrowingCallable shouldRaiseThrowable, java.lang.Class<THROWABLE> type)-
Methods inherited from class org.assertj.core.api.AbstractThrowableAssert
doesNotThrowAnyException, getCause, getRootCause, hasBeenThrown, hasCause, hasCauseExactlyInstanceOf, hasCauseInstanceOf, hasCauseReference, hasMessage, hasMessage, hasMessageContaining, hasMessageContaining, hasMessageContainingAll, hasMessageEndingWith, hasMessageEndingWith, hasMessageFindingMatch, hasMessageMatching, hasMessageNotContaining, hasMessageNotContainingAny, hasMessageStartingWith, hasMessageStartingWith, hasNoCause, hasNoSuppressedExceptions, hasRootCause, hasRootCauseExactlyInstanceOf, hasRootCauseInstanceOf, hasRootCauseMessage, hasRootCauseMessage, hasStackTraceContaining, hasStackTraceContaining, hasSuppressedException
-
Methods inherited from class org.assertj.core.api.AbstractObjectAssert
as, as, extracting, extracting, extracting, extracting, extracting, extracting, getComparatorsByType, hasAllNullFieldsOrProperties, hasAllNullFieldsOrPropertiesExcept, hasFieldOrProperty, hasFieldOrPropertyWithValue, hasNoNullFieldsOrProperties, hasNoNullFieldsOrPropertiesExcept, hasOnlyFields, 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, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOf, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.assertj.core.api.Descriptable
as, describedAs
-
-
-
-
Method Detail
-
buildThrowableAssertFromCallable
private static <V> java.lang.Throwable buildThrowableAssertFromCallable(java.util.concurrent.Callable<V> callable) throws java.lang.AssertionError- Throws:
java.lang.AssertionError
-
catchThrowable
public static java.lang.Throwable catchThrowable(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)
-
catchThrowableOfType
public static <THROWABLE extends java.lang.Throwable> THROWABLE catchThrowableOfType(ThrowableAssert.ThrowingCallable shouldRaiseThrowable, java.lang.Class<THROWABLE> type)
-
-