Testing HL7 Productions
The procedure for testing HL7 productions using %UnitTest.TestProductionOpens in a new tab is identical to that for testing non-HL7 productions:
-
Create a test class that extends %UnitTest.TestProductionOpens in a new tab.
-
Set the value of the test class's PRODUCTION parameter to the name of the production to be tested.
-
Override callback methods in the test class as needed.
-
Execute the test using either the %UnitTest.TestProductionOpens in a new tab Run or Debug methods. Or, execute the test using %UnitTest.TestManager methods.
The next several pages of the tutorial demonstrate testing an HL7 production. The test starts an HL7 message routing production and sends it HL7 data by placing a text file into a directory. The production reads the data from the file, transforms it, and then outputs the result to a different directory. The test then compares the output against a reference file.
The example demonstrates the following common production testing activities:
-
Initializing a set of directories and sub-directories.
-
Copying a text file containing data into an input directory for a production.
-
Comparing a file generated by a production against a reference file.
-
Executing a query against the Ensemble Business Rule Log to determine which routing rule was executed and whether it forwarded the message to the correct target.