You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by Phil H <gi...@gmail.com> on 2021/07/22 03:25:31 UTC

Unit tests for multiple processors

Hi there,

I use the built in unit tests in the maven processor archetype for each of
my processors, but I would like to set up some integration testing using
multiple processors.

Is this possible? If so, anyone care to sling me some example code? Eg: say
I wanted to run a test connecting GenerateFlowFile’s output to PutFile’s
input.

Thanks!
Phil

Re: Unit tests for multiple processors

Posted by Lucas Ottersbach <lu...@gmail.com>.
Hey Phil,

we've set up a "test framework" internally, which orchestrates an existing
NiFi instance via the REST api to test configured processors or process
groups.

The way it works is, it copies a processor or process group (based on it's
name) adds an GenerateFlowFile processor up front and connections for the
downstream, all via the REST api.
This way we can "inject" flow files and examine the resulting flow files
from the output.

Unfortunately, we've not open-sourced our setup.
Hope this helps nonetheless.


Best regards

Lucas


Phil H <gi...@gmail.com> schrieb am Do., 22. Juli 2021, 05:26:

> Hi there,
>
> I use the built in unit tests in the maven processor archetype for each of
> my processors, but I would like to set up some integration testing using
> multiple processors.
>
> Is this possible? If so, anyone care to sling me some example code? Eg: say
> I wanted to run a test connecting GenerateFlowFile’s output to PutFile’s
> input.
>
> Thanks!
> Phil
>