doc / ch.tutteli.atrium.logic.creating.transformers / SubjectChanger / FailureHandler

FailureHandler

interface FailureHandler<T, R> (source)

Represents a handler which is responsible to create the assertion resulting from a failed subject change.

A handler should augment the failing assertion with explanatory assertions in case the user supplied an assertionCreator lambda. Yet, a failure handler might also add additional information -- e.g. regarding the current subject.

Parameters

T - The type of the subject

R - The type of the subject after the subject change (if it were possible).

Functions

createAssertion

abstract fun createAssertion(container: AssertionContainer<T>, descriptiveAssertion: Assertion, maybeAssertionCreator: Option<Expect<R>.() -> Unit>): Assertion

Creates the failing assertion most likely based on the given descriptiveAssertion -- which in turn is based on the previously specified description, representation etc. -- and should incorporate the assertions maybeAssertionCreator would have created for the new subject as explanatory assertions.

Inheritors

DefaultFailureHandlerImpl

class DefaultFailureHandlerImpl<T, R> : SubjectChanger.FailureHandler<T, R>

FailureHandlerAdapter

class FailureHandlerAdapter<T, R1, R> : SubjectChanger.FailureHandler<T, R>

Represents a SubjectChanger.FailureHandler which acts as an adapter for another failure handler by mapping first the given subject to another type R1 which is understood as input of the other failure handler.

ThrowableThrownFailureHandler

class ThrowableThrownFailureHandler<T : Throwable?, R> : SubjectChanger.FailureHandler<T, R>