NIFI-268: If processor is using deprecated annotations, should fail unit test

This commit is contained in:
Mark Payne 2015-03-23 15:39:53 -04:00
parent 54f3476a4c
commit a7b826ae20

View File

@ -137,14 +137,14 @@ public class StandardProcessorTestRunner implements TestRunner {
private static void detectDeprecatedAnnotations(final Processor processor) {
for ( final Class<? extends Annotation> annotationClass : deprecatedTypeAnnotations ) {
if ( processor.getClass().isAnnotationPresent(annotationClass) ) {
logger.warn("Processor is using deprecated Annotation " + annotationClass.getCanonicalName());
Assert.fail("Processor is using deprecated Annotation " + annotationClass.getCanonicalName());
}
}
for ( final Class<? extends Annotation> annotationClass : deprecatedMethodAnnotations ) {
for ( final Method method : processor.getClass().getMethods() ) {
if ( method.isAnnotationPresent(annotationClass) ) {
logger.warn("Processor is using deprecated Annotation " + annotationClass.getCanonicalName() + " for method " + method);
Assert.fail("Processor is using deprecated Annotation " + annotationClass.getCanonicalName() + " for method " + method);
}
}
}