Package org.assertj.core.api
Class WithThrowable
- java.lang.Object
-
- org.assertj.core.api.WithThrowable
-
public class WithThrowable extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Throwable
throwable
-
Constructor Summary
Constructors Constructor Description WithThrowable(java.lang.Throwable exception)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThrowableAssertAlternative<?>
withThrowableOfType(java.lang.Class<? extends java.lang.Throwable> type)
Checks that the underlying throwable is of the given type and returns aThrowableAssertAlternative
to chain further assertions on the underlying throwable.ThrowableAssertAlternative<?>
withThrowableThat()
Returns aThrowableAssertAlternative
to chain assertions on the underlying throwable.
-
-
-
Method Detail
-
withThrowableOfType
public ThrowableAssertAlternative<?> withThrowableOfType(java.lang.Class<? extends java.lang.Throwable> type)
Checks that the underlying throwable is of the given type and returns aThrowableAssertAlternative
to chain further assertions on the underlying throwable.Equivalent to
withThrowableThat().isInstanceOf(type)
- Parameters:
type
- the expectedThrowable
type- Returns:
- a
ThrowableAssertAlternative
built with underlying throwable.
-
withThrowableThat
public ThrowableAssertAlternative<?> withThrowableThat()
Returns aThrowableAssertAlternative
to chain assertions on the underlying throwable.- Returns:
- a
ThrowableAssertAlternative
built with underlying throwable.
-
-