Github user mans2singh commented on the issue:

    https://github.com/apache/nifi/pull/2101
  
    @mattyb149 @MikeThomsen 
    
    If I use `NON_EMPTY_VALIDATOR` - I get the validation exception. I am 
including the exception, property definition and unit test snippets below.  
Please let me know if I am missing anything.
    
    Thanks.
    
    Here is the unit test validation exception with `NON_EMPTY_VALIDATOR`:
    
    `
    java.lang.AssertionError: Processor has 1 validation failures:
    'influxdb-username' validated against '' is invalid because 
influxdb-username cannot be empty
    `
    
    Here is how I am defining the property
    
    ```
        public static final PropertyDescriptor USERNAME = new 
PropertyDescriptor.Builder()
                .name("influxdb-username")
                .displayName("Username")
                .required(false)
                .description("Username for accessing InfluxDB")
                .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
                .build();
    ```
    and here is the unit test:
    
    ```
        @Test
        public void testEmptyUsername() {
            runner.setProperty(PutInfluxDB.USERNAME,"");
            runner.assertValid();
        }
    ```


---

Reply via email to