mirror of
https://github.com/apache/nifi.git
synced 2025-02-16 23:15:36 +00:00
NIFI-268: If processor is using deprecated annotations, should fail unit test
This commit is contained in:
parent
54f3476a4c
commit
a7b826ae20
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user