public interface FailureStrategy
This type does not appear directly in a fluent assertion chain, but you choose a
FailureStrategy by choosing which method to call at the beginning of the chain.
Built-in strategies include:
For more information about the fluent chain, see this FAQ entry.
FailureStrategy implementations are unusual. If you think you need one,
consider these alternatives:
Subject.check(String, Object...), which preserves the existing
FailureStrategyand other context.
When you really do need to create your own strategy, rather than expose your
FailureStrategy instance to users, expose a
StandardSubjectBuilder instance using
void fail(AssertionError failure)
AssertionErroror subclass thereof, and it contains information about the failure, which may include:
We encourage implementations to record as much of this information as practical in the exceptions they may throw or the other records they may make.
Copyright © 2020. All rights reserved.