You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Eric Secules (Jira)" <ji...@apache.org> on 2023/10/03 05:56:00 UTC

[jira] [Resolved] (NIFI-10583) StandardProcessSession and MockProcessSession Handle Attribute Update Differently

     [ https://issues.apache.org/jira/browse/NIFI-10583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Secules resolved NIFI-10583.
---------------------------------
    Resolution: Duplicate

> StandardProcessSession and MockProcessSession Handle Attribute Update Differently
> ---------------------------------------------------------------------------------
>
>                 Key: NIFI-10583
>                 URL: https://issues.apache.org/jira/browse/NIFI-10583
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 1.14.0, 1.17.0
>            Reporter: Eric Secules
>            Assignee: Eric Secules
>            Priority: Major
>
> When writing some custom processors I noticed that I can execute the following code in onTrigger which would set the attribute when I run in StandardProcessSession on a real nifi, but would fail my unit tests if I assert that the attribute exists.
> {code:java}
> FlowFile ff = session.get();
> session.putAttribute(ff, "foo", "123");
> session.transfer.(ff, REL_SUCCESS)
> {code}
> So the StandardProcessSession mutates the flowfile passed in while the MockProcessSession does not.
> The desired outcome is that the StandardProcessSession behaves the same way as the MockProcessSession, ideally neither of them should mutate the flowfile passed in and should only return a copy of the flowfile with the new attribute(s) added.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)