NIFI-852: Ensure that calling MockProcessSession.transfer(FlowFile, Relationship.SELF) will re-queue the FlowFile

This commit is contained in:
Mark Payne 2015-08-14 09:00:49 -04:00
parent 5962404379
commit 1eeed73010
1 changed files with 10 additions and 0 deletions

View File

@ -552,6 +552,11 @@ public class MockProcessSession implements ProcessSession {
@Override @Override
public void transfer(final FlowFile flowFile, final Relationship relationship) { public void transfer(final FlowFile flowFile, final Relationship relationship) {
if (relationship == Relationship.SELF) {
transfer(flowFile);
return;
}
validateState(flowFile); validateState(flowFile);
List<MockFlowFile> list = transferMap.get(relationship); List<MockFlowFile> list = transferMap.get(relationship);
if (list == null) { if (list == null) {
@ -565,6 +570,11 @@ public class MockProcessSession implements ProcessSession {
@Override @Override
public void transfer(final Collection<FlowFile> flowFiles, final Relationship relationship) { public void transfer(final Collection<FlowFile> flowFiles, final Relationship relationship) {
if (relationship == Relationship.SELF) {
transfer(flowFiles);
return;
}
for (final FlowFile flowFile : flowFiles) { for (final FlowFile flowFile : flowFiles) {
validateState(flowFile); validateState(flowFile);
} }