[ 
https://issues.apache.org/jira/browse/NIFI-14164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17913840#comment-17913840
 ] 

Joe Witt commented on NIFI-14164:
---------------------------------

hello this breaks the integration tests when you run the full build.  For 
instance all the aws processor IT fail now with:


{noformat}
[ERROR] org.apache.nifi.processors.aws.s3.ITListS3.testObjectTagsWritten -- 
Time elapsed: 0.008 s <<< FAILURE!
org.opentest4j.AssertionFailedError: Could not invoke methods annotated with 
@OnScheduled annotation due to: java.lang.reflect.InvocationTargetException
        at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:42)
        at org.junit.jupiter.api.Assertions.fail(Assertions.java:150)
        at 
org.apache.nifi.util.StandardProcessorTestRunner.run(StandardProcessorTestRunner.java:215)
        at 
org.apache.nifi.util.StandardProcessorTestRunner.run(StandardProcessorTestRunner.java:197)
        at 
org.apache.nifi.util.StandardProcessorTestRunner.run(StandardProcessorTestRunner.java:192)
        at 
org.apache.nifi.util.StandardProcessorTestRunner.run(StandardProcessorTestRunner.java:187)
        at 
org.apache.nifi.util.StandardProcessorTestRunner.run(StandardProcessorTestRunner.java:182)
        at 
org.apache.nifi.processors.aws.s3.ITListS3.testObjectTagsWritten(ITListS3.java:137)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
Caused by: java.lang.reflect.InvocationTargetException
        at 
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at 
org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotation(ReflectionUtils.java:66)
        at 
org.apache.nifi.util.StandardProcessorTestRunner.run(StandardProcessorTestRunner.java:213)
        ... 8 more
Caused by: java.lang.IllegalStateException: Attempting to retrieve value of 
PropertyDescriptor[Endpoint Override URL] without first evaluating Expressions, 
even though the PropertyDescriptor indicates that the Expression Language is 
Supported. If you realize that this is the case and do not want this error to 
occur, it can be disabled by calling 
TestRunner.setValidateExpressionUsage(false)
        at 
org.apache.nifi.util.MockPropertyValue.ensureExpressionsEvaluated(MockPropertyValue.java:89)
        at 
org.apache.nifi.util.MockPropertyValue.getValue(MockPropertyValue.java:138)
        at 
org.apache.nifi.processors.aws.AbstractAWSCredentialsProviderProcessor.getEndpointConfiguration(AbstractAWSCredentialsProviderProcessor.java:258)
        at 
org.apache.nifi.processors.aws.AbstractAWSCredentialsProviderProcessor.createClient(AbstractAWSCredentialsProviderProcessor.java:248)
        at 
org.apache.nifi.processors.aws.AbstractAWSCredentialsProviderProcessor.lambda$getClient$0(AbstractAWSCredentialsProviderProcessor.java:311)
        at 
com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$14(BoundedLocalCache.java:2688)
        at 
java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916)
        at 
com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2686)
        at 
com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2669)
        at 
com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:112)
        at 
com.github.benmanes.caffeine.cache.LocalManualCache.get(LocalManualCache.java:62)
        at 
org.apache.nifi.processors.aws.AbstractAWSCredentialsProviderProcessor.getClient(AbstractAWSCredentialsProviderProcessor.java:311)
        at 
org.apache.nifi.processors.aws.AbstractAWSCredentialsProviderProcessor.getClient(AbstractAWSCredentialsProviderProcessor.java:315)
        at 
org.apache.nifi.processors.aws.s3.AbstractS3Processor.onScheduled(AbstractS3Processor.java:302)
        at 
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        ... 11 more
{noformat}


> Mock Framework's MockPropertyValue only ensures 
> evaluateAttributeExpressions() called if Expression Language present
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-14164
>                 URL: https://issues.apache.org/jira/browse/NIFI-14164
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>            Reporter: Mark Payne
>            Assignee: Mark Payne
>            Priority: Major
>             Fix For: 2.2.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> In the MockPropertyValue, we ensure that if a PropertyDescriptor declares a 
> property to support Expression Language, that 
> {{evaluateAttributeExpressions()}} is called before calling 
> {{{}getValue(){}}}. But we only ensure this if the property value is set to 
> use Expression Language. Rather, if the developer declares that Expression 
> Language is supported and fails to evaluate Expression Language, we should 
> always throw an Exception regardless of whether or not the property is 
> configured to reference EL.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to