[ 
https://issues.apache.org/jira/browse/NIFI-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15374253#comment-15374253
 ] 

Joseph Witt commented on NIFI-1152:
-----------------------------------

ok i believe pr 639 addresses all we've discussed.

Fixes the root problem bug in StandardProcessSession where when calling the 
transfer methods with specified relationship it was not validating that the 
relationship was supported by that processor and throwing the appropriate 
IllegalArgumentException as stated it would in the nifi-api docs for that 
method.

Adds support in the MockProcessSession to honor this API behavior as well.

Adds tests for both StandardProcessSession and MockProcessSession to verify 
that it will now indeed throw the proper exception when transfer is called with 
invalid/unknown relationships.

These changes then caused InvokeScriptedProcessor tests to break.  This was 
because a couple of tests worked because their behavior was hidden due to the 
previously mentioned StandardProcessSession bug.  This resulted in two tests 
failing because they were using SUCCESS and FAILURE relationships but those 
relationships were not defined as being supported by those scripts.  Also fixed 
the Javadocs for getRelationship of that invoke script processor which claimed 
that SUCCESS and FAILURE would always be provided.  They should never be 
provided as the whole point of invoke scripted processor is to allow full 
processor implementations.

> StandardProcessSession and MockProcessSession should handle transfer to 
> unregistered relationship correctly
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-1152
>                 URL: https://issues.apache.org/jira/browse/NIFI-1152
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Tools and Build
>    Affects Versions: 1.0.0, 0.6.0, 0.7.0, 0.6.1
>            Reporter: Mark Payne
>            Assignee: Joseph Witt
>              Labels: beginner, newbie
>             Fix For: 1.0.0
>
>         Attachments: 
> 0001-Fix-for-NIFI-1838-NIFI-1152-Code-modification-for-ty.patch
>
>
> If a processor calls ProcessSession.transfer(flowFile, 
> NON_EXISTENT_RELATIONSHIP) the NiFi framework will throw a 
> FlowFileHandlingException. However, the Mock Framework simply allows it and 
> does not throw any sort of Exception. This needs to be addressed so that the 
> Mock framework functions the same way as the normal NiFi framework.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to