import ch.powerunit.exception.InternalError;
public interface TestValidator {
default void checkTestAnnotationForMethod(Method m) {
if (Modifier.isStatic(m.getModifiers())) {
throw new InternalError("@Test method is static " + m.toString());
}
if (!Modifier.isPublic(m.getModifiers())) {
throw new InternalError("@Test method is not public "
+ m.toString());
}
if (!Void.TYPE.equals(m.getReturnType())) {
throw new InternalError("@Test method is not void " + m.toString());
}
if (m.getParameterCount() != 0) {
throw new InternalError("@Test method is not 0-parameter "
+ m.toString());
}
}