Github user ToivoAdams commented on a diff in the pull request:
https://github.com/apache/nifi/pull/321#discussion_r60382818
--- Diff: nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java ---
@@ -865,4 +866,21 @@
* @return the State Manager that is used to store and retrieve state
for the given controller service
*/
MockStateManager getStateManager(ControllerService service);
+
+ /**
+ * Maybe we should add possibility to be more precise:
+ * "All FlowFiles must meet all conditions"
+ * or
+ * "At least one FlowFile must meet all conditions"
+ * or
+ * "Each FlowFile should meet at least one condition"
+ *
+ * Current functionality is: "Each FlowFile should meet at least one
condition"
+ * So instead of assertAllConditionsMet we should use something like
assertFlowFileMeetAnyCondition
+ * Or add extra parameter which specifies how FlowFile must meet
conditions.
+ *
+ */
+ void assertAllConditionsMet(final String relationshipName,
ConditionsBuilder... andContentEqual);
--- End diff --
Predicates is a good idea.
âa very valuable method/test would be to indicate that all conditions are
met exactly once.â
You mean exactly one (only one) FlowFile meets all conditions.
runner.assertExactlyOnceAllConditionsMet(MY_RELATIONSHIP, ...
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---