mardi 17 avril 2018

Is it okay for a JUnit test method to throw Exception rather than specific exceptions?

For example, when using reflection, the test method's header would look something like this:

public void validModuleTest() throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {

In this case would it be acceptable to throw Exception? For example:

public void validModuleTest() throws Exception {

Thank you in advance!





Aucun commentaire:

Enregistrer un commentaire