JUnit Exception Testing
Jump to navigation
Jump to search
External
Internal
Idioms
Try/Catch
try {
...
fail("should have thrown exception");
}
catch(SomeException e) {
assertEquals("some message", e.getMessage());
}
try {
...
fail("should have thrown exception");
}
catch(SomeException e) {
assertEquals("some message", e.getMessage());
}