Hi,

I'm getting some strange behavior on unit tests.

(https://github.com/nologic/nifi/tree/NIFI-4731,
https://github.com/nologic/nifi/blob/3a4749a7b467fff0188174bc256e53818d43b7ba/nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/test/java/org/apache/nifi/processors/gcp/bigquery/PutBigQueryStreamTest.java#L65
)

The property looks like this:
    public static final PropertyDescriptor MAX_ROW_SIZE = new
PropertyDescriptor
        .Builder().name(BigQueryAttributes.MAX_ROW_SIZE_ATTR)
        .displayName("Max row size")
        .description(BigQueryAttributes.MAX_ROW_SIZE_DESC)
        .required(true)
        .defaultValue("1 MB")
        .addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
        .build();

This works great in NiFi, but when I run it via a unit test. I get an
exception (even with a default value):
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.543 sec
<<< FAILURE! - in
org.apache.nifi.processors.gcp.bigquery.PutBigQueryStreamTest
testSuccessfulInsert(org.apache.nifi.processors.gcp.bigquery.PutBigQueryStreamTest)
Time elapsed: 1.326 sec  <<< FAILURE!
java.lang.AssertionError: java.lang.NumberFormatException: For input
string: "2 MB"
at
org.apache.nifi.processors.gcp.bigquery.PutBigQueryStreamTest.testSuccessfulInsert(PutBigQueryStreamTest.java:79)
Caused by: java.lang.NumberFormatException: For input string: "2 MB"
So, I tried changing the value to a number, which fails the test as
expected:
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.665 sec
<<< FAILURE! - in
org.apache.nifi.processors.gcp.bigquery.PutBigQueryStreamTest
testSuccessfulInsert(org.apache.nifi.processors.gcp.bigquery.PutBigQueryStreamTest)
Time elapsed: 1.437 sec  <<< FAILURE!
java.lang.AssertionError:
Processor has 1 validation failures:
'bq.row.size' validated against '1024' is invalid because Must be of format
<Data Size> <Data Unit> where <Data Size> is a non-negative integer and
<Data Unit> is a supported Data Unit, such as: B, KB, MB, GB, TB
What am I missing? Why is the default throwing an exception? Maybe the
validator is broken?

Thanks,
Mike.

--
This email may contain material that is confidential for the sole use of
the intended recipient(s).  Any review, reliance or distribution or
disclosure by others without express permission is strictly prohibited.  If
you are not the intended recipient, please contact the sender and delete
all copies of this message.
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB