Developer Guide
Also available as:
loading table of contents...

Instantiate TestRunner

Most unit tests for a Processor or a Controller Service start by creating an instance of the TestRunner class. In order to add the necessary classes to your Processor, you can use the Maven dependency:

 <version>${nifi version}</version>

We create a new TestRunner by calling the static newTestRunner method of the TestRunners class (located in the org.apache.nifi.util package). This method takes a single argument. That argument can either be the class of the Processor to test or can be an instance of a Processor.