doc / ch.tutteli.atrium.assertions.any.typetransformation / ExplanatoryTypeTransformationFailureHandler / createAndAddAssertionToPlant

createAndAddAssertionToPlant

fun createAndAddAssertionToPlant(warningTransformationFailed: Translatable, subjectPlant: BaseAssertionPlant<T?, *>, failingAssertion: Assertion, assertionCreator: AssertionPlant<TSub>.() -> Unit): Unit (source)

Overrides TypeTransformationFailureHandler.createAndAddAssertionToPlant

Wraps the assertions which might be created by assertionCreator into an AssertionGroup with an ExplanatoryAssertionGroupType and adds it to the given subjectPlant.

Parameters

warningTransformationFailed - The type to which the subjectPlant's subject should have been down-casted.

subjectPlant - The plant to which additional assertions would have been added.

assertionCreator - The lambda which could have created subsequent assertions for the down-casted AssertionPlant.subject.

Exceptions

AssertionError - Might throw an AssertionError depending on the subjectPlant.