mattyb149 commented on a change in pull request #3974: Add onUnscheduled
support for ExecuteGroovyScript Processor
URL: https://github.com/apache/nifi/pull/3974#discussion_r364991204
##########
File path:
nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/test/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScriptTest.java
##########
@@ -427,6 +427,29 @@ public void test_withWriter() throws Exception {
flowFile.assertContentEquals("5678".getBytes(StandardCharsets.UTF_16LE));
}
+ @Test
+ public void test_onStart_onStop() throws Exception {
+ runner.setProperty(ExecuteGroovyScript.SCRIPT_FILE,
TEST_RESOURCE_LOCATION + "test_onStart_onStop.groovy");
+ runner.assertValid();
+ runner.enqueue("");
+ runner.run();
+
+
runner.assertAllFlowFilesTransferred(ExecuteGroovyScript.REL_SUCCESS.getName(),
1);
+ final List<MockFlowFile> result =
runner.getFlowFilesForRelationship(ExecuteGroovyScript.REL_SUCCESS.getName());
+ MockFlowFile resultFile = result.get(0);
+ resultFile.assertAttributeExists("a");
+ resultFile.assertAttributeEquals("a", "A");
+ // Inspect the output visually for onStop, no way to pass back values
+ }
+
+ @Test
Review comment:
Sounds good, I'll give this a go, better to have the computer validate than
the eyes :) Thanks!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services