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;