doc / ch.tutteli.atrium.reporting.impl / DefaultAssertionFormatterController / format

format

fun format(assertion: Assertion, parameterObject: AssertionFormatterParameterObject): Unit (source)

Overrides AssertionFormatterController.format

Finds a suitable AssertionFormatter -- which was previously registered -- for the given assertion and formats it.

The parameterObject allows to define an assertionFilter to filter out Assertions (for instance, filter out messages which hold. Moreover the controller should take into account whether the control flow AssertionFormatterParameterObject.isNotInDoNotFilterGroup or is in such a group, in which case the filtering should not apply.

Last but not least, an AssertionFormatterController has to take care of AssertionGroup with an InvisibleAssertionGroupType as its AssertionGroup.type. Such groups should not be format as group but instead each AssertionGroup.assertions should be formatted. This also means, that if there are nested assertion groups with an InvisibleAssertionGroupType, that their AssertionGroup.assertions should be formatted as if they were all added directly in the surrounding assertion group.

Parameters

assertion - The assertion which shall be formatted.

parameterObject - Used to share data between this AssertionFormatterController and the registered AssertionFormatters.

Exceptions

UnsupportedOperationException - if no suitable AssertionFormatter is found.

See Also

AssertionFormatterParameterObject