public void testFoo() { try { doSomething(); fail("should have thrown an exception"); } catch (Exception e) { } }
@Test(expected = Exception.class)