Exception handling on REST unit test