TNG / ArchUnit

A Java architecture test library, to specify and assert architecture rules in plain Java
http://archunit.org
Apache License 2.0
3.17k stars 287 forks source link

Custom Error Messages for StoreUpdateFailedException #1249

Open bennetkammer opened 6 months ago

bennetkammer commented 6 months ago

Hi Guys, i implemented various testcases, which per default disable store updates. I would like to let the developers know why the test failed and especially at which point or class the change happens.

I am aware about custom error messages, but unfortunately this doesn't apply to exceptions. My current approach is to throw my own exception, pointing towards the JavaClass which throws the StoreUpdatedFailedException. However, it seems that the framework is not designed to check rules on individual Java classes. Is there any possibility to extract the specific JavaClass that throws the exception?

Thanks for any assistance