markap14 commented on a change in pull request #4746:
URL: https://github.com/apache/nifi/pull/4746#discussion_r561092480



##########
File path: 
nifi-commons/nifi-expression-language/src/test/java/org/apache/nifi/attribute/expression/language/TestStandardPreparedQuery.java
##########
@@ -309,6 +309,24 @@ public void testVariableImpacted() {
         
assertTrue(Query.prepare("${anyMatchingAttribute('a.*'):equals('hello')}").getVariableImpact().isImpacted("attr"));
     }
 
+    @Test
+    public void testIsExpressionLanguagePresent() {
+        assertFalse(Query.prepare("value").isExpressionLanguagePresent());
+        assertFalse(Query.prepare("").isExpressionLanguagePresent());
+
+        assertTrue(Query.prepare("${variable}").isExpressionLanguagePresent());
+        
assertTrue(Query.prepare("${hostname()}").isExpressionLanguagePresent());
+        
assertTrue(Query.prepare("${hostname():equals('localhost')}").isExpressionLanguagePresent());
+        
assertTrue(Query.prepare("prefix-${hostname()}").isExpressionLanguagePresent());
+        
assertTrue(Query.prepare("${hostname()}-suffix").isExpressionLanguagePresent());
+        
assertTrue(Query.prepare("${variable1}${hostname()}${variable2}").isExpressionLanguagePresent());
+        
assertTrue(Query.prepare("${${variable}}").isExpressionLanguagePresent());
+
+        assertFalse(Query.prepare("${}").isExpressionLanguagePresent());
+
+        assertTrue(Query.prepare("#{param}").isExpressionLanguagePresent());

Review comment:
       This should be false, not true. This is not expression language but 
rather a parameter reference. The value that will be made available to the 
component will be the fully resolved value, after substituting in the parameter.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to