Unit Test for Flow Outputting a Multiline String

Unit Test for Flow Outputting a Multiline String

Comments

  • Note: currently using version 3.2.0 Revision 26300M, so this may not be an issue in newer versions.

    I have a flow which, as its input, takes in a custom structure with many different properties. The flow then builds up a string of HTML, based off of the properties of the input structure (usually using step AppendHTMLLine and a mapping type of Text Merge.HTML" to apply some special formatting for each property). The flow then outputs this large HTML string.

    When adding a test under "Flow Unit Tests"

  • The best solution here is to write your HTML explictly using an nVelocity merge step. Here is a link to the document describing its use. http://documentation.decisions.com/advanced-text-merge-using-the-nvelocity-component/

    You can create your HTML and then use $variableName to create parameterized inputs. This step respects html tags the most out of all of Decisions merge types. After creating this merge you can just pass the output string to whereever you need to map it to, there is no need for an additional merge step.

    The best way to view the raw HTML being created is to pass the output of the nVelocity step to a log step and then open the logs and validate the html being created. You could also use a create file step and pass the html text into it. The debugge hides all HTML/XML/JSON tags from view by default.

Sign In or Register to comment.