Skip to content

attach something if assertion failed #2733

Answered by scordio
NewbieProger asked this question in Q&A
Discussion options

You must be logged in to vote

Hard assertions do not really have a callback mechanism, but soft assertions might serve your purpose.

There are two options:

Both ways allow you to provide your own logic to be executed with each assertion error.

Examples of both solutions are in the AssertJ documentation.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by NewbieProger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants