Asserting error codes by extending @Test

View: New views
1 Messages — Rating Filter:   Alert me  

Asserting error codes by extending @Test

by pmanvi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I thought it would be nice to assert error codes in annotation.

For example, something like this.
@Test(expected="ServiceException" errorCode="500")

/**
 * Optionally specify <code>errorCode</code> thrown from the Exception
 * Exception class has to have ing getErrorCode() method defined
.*/
int errorCode() default -1L;

in similar line to timeout()