This is an automated email from the ASF dual-hosted git repository.
exceptionfactory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new cbd4d676a4 NIFI-14276 Added clearQueue method to TestRunner interface
(#9768)
cbd4d676a4 is described below
commit cbd4d676a4285c357197f0ca79b66e4e6fe8d391
Author: dan-s1 <[email protected]>
AuthorDate: Tue Mar 4 20:19:28 2025 -0500
NIFI-14276 Added clearQueue method to TestRunner interface (#9768)
Signed-off-by: David Handermann <[email protected]>
---
.../main/java/org/apache/nifi/util/StandardProcessorTestRunner.java | 1 +
nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java | 5 +++++
2 files changed, 6 insertions(+)
diff --git
a/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java
b/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java
index 68d1e90e20..824ad90cf8 100644
---
a/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java
+++
b/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java
@@ -542,6 +542,7 @@ public class StandardProcessorTestRunner implements
TestRunner {
return flowFileQueue.size();
}
+ @Override
public void clearQueue() {
// TODO: Add #clear to MockFlowFileQueue or just point to new instance?
while (!flowFileQueue.isEmpty()) {
diff --git a/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java
b/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java
index 0f5c1ecf73..60b237a958 100644
--- a/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java
+++ b/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java
@@ -535,6 +535,11 @@ public interface TestRunner {
*/
QueueSize getQueueSize();
+ /**
+ * Allow for clearing the queue from all remaining flow files.
+ */
+ void clearQueue();
+
/**
* @param name of counter
* @return the current value of the counter with the specified name, or
null