atrium-domain-builders-jvm / ch.tutteli.atrium.domain.builders.creating.changers.impl.subjectchanger / FailureHandlerOptionImpl

FailureHandlerOptionImpl

class FailureHandlerOptionImpl<T, R> : SubjectChangerBuilder.FailureHandlerOption<T, R> (source)

Constructors

<init>

FailureHandlerOptionImpl(transformationStep: SubjectChangerBuilder.TransformationStep<T>, transformation: (T) -> <ERROR CLASS><R>)

Properties

transformation

val transformation: (T) -> <ERROR CLASS><R>

The previously specified new subject.

transformationStep

val transformationStep: SubjectChangerBuilder.TransformationStep<T>

The so far chosen options up to the TransformationStep step.

Functions

withDefaultFailureHandler

fun withDefaultFailureHandler(): SubjectChangerBuilder.FinalStep<T, R>

Uses the default SubjectChanger.FailureHandler which builds the failing assertion based on the specified TransformationStep.description and TransformationStep.representation and includes the assertions a given assertionCreator lambda would create.

withFailureHandler

fun withFailureHandler(failureHandler: <ERROR CLASS><T, R>): SubjectChangerBuilder.FinalStep<T, R>

Uses the given failureHandler as SubjectChanger.FailureHandler to create the failing assertion in case the subject change fails.

Inherited Functions

build

open fun build(): <ERROR CLASS><T, R>

Skips this step by using withDefaultFailureHandler and calls FinalStep.build.

withFailureHandlerAdapter

open fun <R1> withFailureHandlerAdapter(failureHandler: <ERROR CLASS><R1, R>, map: (T) -> R1): SubjectChangerBuilder.FinalStep<T, R>

Uses the given failureHandler as SubjectChanger.FailureHandler to create the failing assertion in case the subject change fails but previously maps the subject from T to R1 as the failure handler only deals with R1 subjects.

Extension Functions

asExpect

fun <T, A> A.asExpect(): <ERROR CLASS><T>
fun <T : Any, A> A.asExpect(assertionCreator: <ERROR CLASS><T>.() -> Unit): A

Turns Assert or AssertionPlantNullable into an Expect so that you can use new functionality which is not available on Assert/AssertionPlantNullable.