Is assert(false);
an acceptable way to cause a test to fail?
Also, should I even be causing a TestNG test to fail if a NoSuchMethodException or SecurityException is thrown while trying to access private methods of a class or should I just print the exception's stack trace?
@Test
public void getLevelTest() {
try {
menu.getClass().getDeclaredMethod("getLevel",int.class,String.class);
} catch (NoSuchMethodException | SecurityException e) {
assert(false);
}
}