doc / ch.tutteli.atrium.assertions.throwable.thrown.creators / ThrowableThrownAssertionCreator

ThrowableThrownAssertionCreator

class ThrowableThrownAssertionCreator<TExpected : Throwable> : ThrowableThrown.Creator<TExpected>
Deprecated: Please open an issue if you used this class; will be removed with 1.0.0

Represents a creator of a sophisticated a Throwable (of type TExpected) was thrown assertion.

It uses the given absentThrowableMessageProvider in case no Throwable was thrown at all and uses a DownCaster to perform the down-cast to the desired type TExpected (for this it passes on the given failureHandler to the DownCaster)

Parameters

TExpected - The type of the Throwable which we expect was thrown.

Constructors

<init>

ThrowableThrownAssertionCreator(absentThrowableMessageProvider: ThrowableThrown.AbsentThrowableMessageProvider, failureHandler: AnyTypeTransformation.TypeTransformationFailureHandler<Throwable, TExpected>)

Represents a creator of a sophisticated a Throwable (of type TExpected) was thrown assertion.

Functions

executeActAndCreateAssertion

fun executeActAndCreateAssertion(throwableThrownBuilder: ThrowableThrownBuilder, description: Translatable, expectedType: KClass<TExpected>, assertionCreator: AssertionPlant<TExpected>.() -> Unit): Unit

Executes the act lambda of the given throwableThrownBuilder, catches any thrown Throwable, creates based on it a corresponding Assertion representing the sophisticated assertion and also checks whether it holds or not.