You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Matt Burgess (Jira)" <ji...@apache.org> on 2023/10/09 17:37:00 UTC

[jira] [Resolved] (NIFI-4590) customValidate() fails during unit tests when isExpressionLanguagePresent() is called

     [ https://issues.apache.org/jira/browse/NIFI-4590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Burgess resolved NIFI-4590.
--------------------------------
    Resolution: Implemented

This error was fixed in NIFI-4717 and further improved in NIFI-6318, closing.

> customValidate() fails during unit tests when isExpressionLanguagePresent() is called 
> --------------------------------------------------------------------------------------
>
>                 Key: NIFI-4590
>                 URL: https://issues.apache.org/jira/browse/NIFI-4590
>             Project: Apache NiFi
>          Issue Type: Test
>          Components: Core Framework
>            Reporter: Matt Burgess
>            Priority: Major
>
> When isExpressionLanguagePresent() is called from a customValidate() method in a processor during a unit test, a NullPointerException is thrown.
> Inside that method in MockPropertyValue, a Boolean (not boolean) reference "expectExpressions" appears that expectExpressions has not yet been populated by the time isExpressionLanguagePresent() is called, and the if(!expectExpressions) clause results in an NPE.
> Not sure if the fix is to change expectExpressions to be a boolean, or to allow for expectExpressions == null in isExpressionLanguagePresent(), or some third option to achieve the desired behavior while maintaining an accurate mock of true behavior.



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