AssertionScope
The scope in which assertions are executed.
An assertion scope defines how assertion results are consumed. The default implementation throws an AssertionError when an assertion fails. Custom implementations can define different behaviour, such as collecting failures for soft assertions or adding additional context to failure messages.
This interface uses a DSL marker annotation (AssertionScope.Dsl) to prevent unwanted implicit receivers in assertion lambdas, ensuring type safety and preventing accidental calls to functions from other scopes.
Inheritors
Types
Default implementation of AssertionScope that throws an AssertionError when an assertion fails.
Functions
Executes the given assertion checker and consumes its result.
Consumes an assertion result, typically by throwing an AssertionError if the assertion fails.
Invokes the given assertion block with this AssertionScope as the context receiver.
Executes the given assertion block in a "soft" mode, collecting all assertion failures and reporting them together at the end.