Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-4590

customValidate() fails during unit tests when isExpressionLanguagePresent() is called

    XMLWordPrintableJSON

Details

    • Test
    • Status: Resolved
    • Major
    • Resolution: Implemented
    • None
    • None
    • Core Framework
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mattyb149 Matt Burgess
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: