Github user mattyb149 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2443#discussion_r170033540
--- Diff:
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoTest.java
---
@@ -69,6 +70,7 @@
@Before
public void setup() {
runner = TestRunners.newTestRunner(GetMongo.class);
+ runner.setProperty(GetMongo.QUERY, "{}");
--- End diff --
Does this need to be here? Seems like it might hide the cases when Query is
empty, which would be the existing behavior. If it's because of the validator,
then it should accept an empty query as valid since the property is not
required. Also, can you add a unit test (or update the existing one) for when
the Query is empty and there is no incoming flow file (but there is an incoming
connection)? That would test the other half of the conditions for the exception
block you added at the top of onTrigger.
---