dan-s1 commented on code in PR #6798:
URL: https://github.com/apache/nifi/pull/6798#discussion_r1054634880
##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestTransformXml.java:
##########
@@ -297,4 +301,61 @@ public void
testTransformSecureProcessingEnabledXslWithEntity() throws IOExcepti
transformed.assertContentEquals("<?xml version=\"1.0\"
encoding=\"UTF-8\"?>");
}
+
+ @Test
+ public void testNonMatchingTemplateTag() throws IOException {
+ final TestRunner runner = TestRunners.newTestRunner(new
TransformXml());
+ runner.setProperty("header", "Test for mod");
+ runner.setProperty(TransformXml.XSLT_FILE_NAME,
"src/test/resources/TestTransformXml/nonMatchingEndTag.xsl");
+
+
runner.enqueue(Paths.get("src/test/resources/TestTransformXml/math.xml"));
+ runner.run();
+
+ runner.assertAllFlowFilesTransferred(TransformXml.REL_FAILURE);
+ MockComponentLog logger = runner.getLogger();
+ assertFalse(logger.getErrorMessages().isEmpty());
+ assertTrue(logger.getErrorMessages().size() >= 1);
+ String firstMessage = logger.getErrorMessages().get(0).getMsg();
+ assertTrue(firstMessage.contains("xsl:template"));
+ assertTrue(firstMessage.contains("Line#"));
+ assertTrue(firstMessage.contains("Column#"));
Review Comment:
No problem. I thought asserting the existence of the Line# and Column# would
be helpful as it addresses the request in the ticket to have them included and
that they end up as part of a bulletin in the UI.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]