unit test with expecting exception

Can I specify JUnit's "expected" parameter for ITestCase?
An equivalent of
@Test (expected=IndexOutOfBoundsException.class)
prettyPrint();
1 comment
Comment actions Permalink
nvm, found myself.
That's "assert throws" statement
list<int> list = null; 
assert list.get(1); throws NullPointerException <no message>;
prettyPrint();
0

Please sign in to leave a comment.