Github user adyoun2 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/3033#discussion_r225122894
--- Diff:
nifi-mock/src/main/java/org/apache/nifi/util/MockProcessSession.java ---
@@ -458,6 +458,9 @@ public MockFlowFile importFrom(final Path path, final
boolean keepSourceFile, Fl
newFlowFile.setData(baos.toByteArray());
newFlowFile = putAttribute(newFlowFile,
CoreAttributes.FILENAME.key(), path.getFileName().toString());
+ if (!keepSourceFile) {
--- End diff --
It is necessary, in that the mock was ignoring the attribute, so when
tested with multiple files, behaviour was non-deterministic, as it could quite
easily pick up the same file again.
---