unit test with expecting exception

  • 14
  • 1

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