Eclipse's CodePro generates JUnit tests, however, all test methods that it generates throw Exception
even if it is impossible for a checked exception to be thrown. Is this a limitation of CodePro, or a good JUnit practice I haven't seen before?
For example:
@Test
public void testCategory_1()
throws Exception {
String categoryName = "";
Category result = new Category(categoryName);
// add additional test code here
assertNotNull(result);
assertEquals(null, result.getCategoryName());
}
Where new Category(String)
and result.getCategoryName()
don't throw any checked exceptions.