net.sourceforge.pmd.rules.migration
public class JUnitUseExpected extends AbstractJUnitRule
public void testFoo() {
try {
doSomething();
fail("should have thrown an exception");
} catch (Exception e) {
}
}
In JUnit 4, use
@Test(expected = Exception.class)
| Method Summary | |
|---|---|
| Object | visit(ASTClassOrInterfaceBodyDeclaration node, Object data) |
| Object | visit(ASTMethodDeclaration node, Object data) |