Package org.assertj.core.api
Class SoftThrowableTypeAssert<T extends Throwable>
java.lang.Object
org.assertj.core.api.ThrowableTypeAssert<T>
org.assertj.core.api.SoftThrowableTypeAssert<T>
- All Implemented Interfaces:
Descriptable<ThrowableTypeAssert<T>>
ThrowableTypeAssert for soft assertions.
- Since:
- 3.23.0
-
Field Summary
Fields inherited from class org.assertj.core.api.ThrowableTypeAssert
description, expectedThrowableType -
Constructor Summary
ConstructorsConstructorDescriptionSoftThrowableTypeAssert(Class<? extends T> throwableType, SoftAssertionsProvider softAssertionsProvider) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected ThrowableAssertAlternative<T> buildThrowableTypeAssert(T throwable) protected voidcheckThrowableType(Throwable throwable) describedAs(Description description) Sets the description of the assertion that is going to be called after.Methods inherited from class org.assertj.core.api.ThrowableTypeAssert
isThrownByMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.assertj.core.api.Descriptable
as, as, as, describedAs, describedAs
-
Constructor Details
-
SoftThrowableTypeAssert
public SoftThrowableTypeAssert(Class<? extends T> throwableType, SoftAssertionsProvider softAssertionsProvider) Default constructor.- Parameters:
throwableType- class representing the target (expected) exceptionsoftAssertionsProvider- the soft assertion instance used later on to proxyThrowableAssert
-
-
Method Details
-
buildThrowableTypeAssert
- Overrides:
buildThrowableTypeAssertin classThrowableTypeAssert<T extends Throwable>
-
checkThrowableType
- Overrides:
checkThrowableTypein classThrowableTypeAssert<T extends Throwable>
-
describedAs
Description copied from class:ThrowableTypeAssertSets the description of the assertion that is going to be called after.You must set it before calling the assertion otherwise it is ignored as the failing assertion breaks the chained call by throwing an AssertionError.
This overloaded version of "describedAs" offers more flexibility than the one taking a
Stringby allowing users to pass their own implementation of a description. For example, a description that creates its value lazily, only when an assertion failure occurs.- Specified by:
describedAsin interfaceDescriptable<T extends Throwable>- Overrides:
describedAsin classThrowableTypeAssert<T extends Throwable>- Parameters:
description- the new description to set.- Returns:
thisobject.
-