NIFI-3218: fixed incorrect assertion for self-routing flowfiles in MockProcessSession

Signed-off-by: Joe Skora <jskora@apache.org>

This closes #1988.
This commit is contained in:
m-hogue 2017-07-07 06:46:02 -04:00 committed by Joe Skora
parent 58f60b3cf0
commit 07a6499dae
1 changed files with 3 additions and 3 deletions

View File

@ -756,10 +756,10 @@ public class MockProcessSession implements ProcessSession {
throw new IllegalArgumentException("I only accept MockFlowFile"); throw new IllegalArgumentException("I only accept MockFlowFile");
} }
// if the flowfile provided was created in this session (i.e. it's in currentVersions), // if the flowfile provided was created in this session (i.e. it's in currentVersions and not in original versions),
// then throw an exception indicating that you can't transfer flowfiles back to self. // then throw an exception indicating that you can't transfer flowfiles back to self.
// this mimics the behavior of StandardProcessSession // this mimics the same behavior in StandardProcessSession
if(currentVersions.get(flowFile.getId()) != null) { if(currentVersions.get(flowFile.getId()) != null && originalVersions.get(flowFile.getId()) == null) {
throw new IllegalArgumentException("Cannot transfer FlowFiles that are created in this Session back to self"); throw new IllegalArgumentException("Cannot transfer FlowFiles that are created in this Session back to self");
} }