Add message element to @Test?

"[email protected] [junit]" <[email protected]> 31 Aug 2017 17:13:26 +0000
Newsgroups gmane.comp.java.junit.user
Message-ID <[email protected]>
Would it make sense to enhance the @Test annotation with a new optional message element? Currently all of the Assert methods have overloaded forms including a message parameter in order to report what went wrong in human readable terms. However when you use the @Test annotation with an expected element to check that a particular exception was thrown there's no way to report a custom message back to the user.

http://junit.org/junit4/javadoc/latest/org/junit/Test.html#expected()

Alternatively, could we add a method to the ExpectedException rule to set a custom failure message?

http://junit.org/junit4/javadoc/latest/org/junit/rules/ExpectedException.html

------------------------------------
Posted by: [email protected]
------------------------------------