Add message element to @Test?
| 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] ------------------------------------