Is it possible to test for multiple exceptions in a single JUnit unit test? I know for a single exception one can use, for example
@Test(expected=Illega
Although this is not possible with JUnit 4, it is possible if you switch to TestNG, which allows you to write
@Test(expectedExceptions = {IllegalArgumentException.class, NullPointerException.class})