You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2020/02/26 15:52:38 UTC

[GitHub] [nifi] mattyb149 commented on a change in pull request #4012: NIFI-7055 createListValidator should treat ", " as invalid

mattyb149 commented on a change in pull request #4012: NIFI-7055 createListValidator should treat "," as invalid
URL: https://github.com/apache/nifi/pull/4012#discussion_r384584531
 
 

 ##########
 File path: nifi-commons/nifi-utils/src/test/java/org/apache/nifi/util/validator/TestStandardValidators.java
 ##########
 @@ -184,6 +184,25 @@ public void testListValidator() {
         assertFalse(vr.isValid());
         assertEquals(1, mockValidator.getValidateCallCount());
 
+        // An empty list is the same as null, "" or " "
+        vr = val.validate("List", ",", validationContext);
+        assertFalse(vr.isValid());
+        assertEquals(0, mockValidator.getValidateCallCount());
+
+        vr = val.validate("List", " , ", validationContext);
+        assertFalse(vr.isValid());
+        assertEquals(1, mockValidator.getValidateCallCount());
+
+        // will evaluate to no entry
+        vr = val.validate("List", ",,,,", validationContext);
+        assertFalse(vr.isValid());
+        assertEquals(0, mockValidator.getValidateCallCount());
+
+        // will evaluate to an empty element
+        vr = val.validate("List", ",foo", validationContext);
 
 Review comment:
   Since this list has one non-empty element, should it be valid?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services