I know that one can define an \'expected\' exception in JUnit, doing:
@Test(expect=MyException.class) public void someMethod() { ... }
The most concise syntax is provided by catch-exception:
import static com.googlecode.catchexception.CatchException.*; catchException(myObj).doSomethingNasty(); assertTrue(caughtException().getCause() instanceof MyException);