assertj icon indicating copy to clipboard operation
assertj copied to clipboard

Improve 'Expecting code to raise a throwable' when lambda returns a value

Open findepi opened this issue 2 years ago • 4 comments

assertThatThrownBy throws "Expecting code to raise a throwable" when called code doesn't throw. When test assertion fails, it's tempting to know what did the code do instead.

Enhance "Expecting code to raise a throwable" to mention produced value in case when the lambda is a producer.

findepi avatar May 14 '23 09:05 findepi

The related change has been reverted in #3318 and the topic should be evaluated again together with #1652 and #2519.

scordio avatar Jan 02 '24 22:01 scordio

@scordio apologies for https://github.com/assertj/assertj/issues/3314 and thank you for the quick revert.

findepi avatar Jan 04 '24 19:01 findepi

No problem at all, @findepi! Unfortunately, we missed that potential breaking change but now we learned 🙂

scordio avatar Jan 05 '24 09:01 scordio

  • Related to https://github.com/junit-team/junit5/issues/1576

sbrannen avatar Jan 09 '24 11:01 sbrannen