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

ASF GitHub Bot commented on NIFI-5318:
--------------------------------------

Github user peter-gergely-horvath commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2843#discussion_r200807310
  
    --- Diff: nifi-docs/src/main/asciidoc/developer-guide.adoc ---
    @@ -2296,6 +2296,32 @@ threads that should be used to run the Processor can
     be set via the `setThreadCount(int)` method.
     
     
    +=== Experimental NiFi Flow test harness
    +
    +NiFi now has an experimental feature for full end-to-end testing of flows. 
This allows us
    +to take a NiFi flow, install it to a test NiFi instance, run it and make 
Java unit test
    +like asserts regarding its behaviour.
    +
    +The class `org.apache.nifi.test.TestNiFiInstance` is a thin wrapper that 
allows us
    +to manipulate a NiFi installation and deploy a flow with some adjustments
    +to its configuration, including changing processor properties and 
replacing processor
    +classes with mocks.
    +
    +In order to add the necessary classes to your project,
    +you can use the Maven dependency:
    +
    +[source]
    +----
    +<dependency>
    +   <groupId>org.apache.nifi</groupId>
    +   <artifactId>nifi-test</artifactId>
    +   <version>${nifi version}</version>
    +</dependency>
    +----
    +
    +For further documentation, please consult the JavaDoc of
    +`org.apache.nifi.test.TestNiFiInstance`. For samples, please take a look at
    
+link:https://github.com/apache/nifi/tree/master/nifi-test/src/test/java/org/apache/test/samples[samples
 on GitHub^].
    --- End diff --
    
    The idea is that users should be able to write test cases in Java for NiFi 
flows: these code samples linked there would demonstrate creating a test case 
like that.


> Implement NiFi test harness
> ---------------------------
>
>                 Key: NIFI-5318
>                 URL: https://issues.apache.org/jira/browse/NIFI-5318
>             Project: Apache NiFi
>          Issue Type: New Feature
>            Reporter: Peter Horvath
>            Priority: Major
>
> Currently, it is not really possible to automatically test the behaviour of a 
> specific NiFi flow and make unit test type asserts if it works as expected. 
> For example, if the expected behaviour of a NiFi flow is that a file placed 
> to a specific directory will trigger some operation after which some output 
> file will appear at another directory, once currently can only do one thing: 
> test the NiFi flow manually. 
> Manual testing is especially hard to manage if a NiFi flow is being actively 
> developed: any change to a complex, existing NiFi flow might require a lot of 
> manual testing just to ensure there are no regressions introduced. 
> Some kind of Java API that allows managing a NiFi instance and manipulating 
> flow deployments like for example, [Codehaus 
> Cargo|]https://codehaus-cargo.github.io/] would be of great help. 
>  
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to