public class SoftThrowableTypeAssert<T extends Throwable> extends ThrowableTypeAssert<T>
description, expectedThrowableType| Constructor and Description |
|---|
SoftThrowableTypeAssert(Class<? extends T> throwableType,
SoftAssertionsProvider softAssertionsProvider)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected ThrowableAssertAlternative<T> |
buildThrowableTypeAssert(T throwable) |
SoftThrowableTypeAssert<T> |
describedAs(Description description)
Sets the description of the assertion that is going to be called after.
|
isThrownByclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitas, as, as, describedAspublic SoftThrowableTypeAssert(Class<? extends T> throwableType, SoftAssertionsProvider softAssertionsProvider)
throwableType - class representing the target (expected) exceptionsoftAssertionsProvider - the soft assertion instance used later on to proxy ThrowableAssertprotected ThrowableAssertAlternative<T> buildThrowableTypeAssert(T throwable)
buildThrowableTypeAssert in class ThrowableTypeAssert<T extends Throwable>public SoftThrowableTypeAssert<T> describedAs(Description description)
ThrowableTypeAssertYou 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 String by 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.
describedAs in interface Descriptable<ThrowableTypeAssert<T extends Throwable>>describedAs in class ThrowableTypeAssert<T extends Throwable>description - the new description to set.this object.Copyright © 2025. All rights reserved.