Use Test Data
Good practices for the use of test data
Last updated
Good practices for the use of test data
Last updated
The first question that might come up is: "Where can I get test data?" that is needed to debug and test my script? The answer is simple as that: run your process, and grab the documents that hit the - not yet developed - Data-Process Shape which is going to host the script.
Imaging, you have a process that executes a Business-Rule and you want to serializes the Business-Rule XML results into a plain string. You want to develop a script for that XML conversion purpose, and you need test data.
Temporarily add a Stop-Shape where you want to insert the script.
Run your process.
Copy and paste as many documents as you need from the Stop-Shape,
and save each document as a file
in your script's testData
folder, in you project directory.
In your Test class read the documents from file:
Note: The _testfiles
object has been created on the class level, and it point to testFiles directory, relative to the Test file location.
If you test on a local machine, using your local ATOM, you can use the testData directly from your ATOM. Copy the testData's full-path, which is probably: %UserProfile%\Documents\GroovyTraining.
Setup a generic (empty) Disk v2 connector:
Create a generic query Disk v2 operation:
Amend your Test-Process to read test data from disk:
The SetProperties Shape sets the testData directory and it defines
DDP_FileFilter = *.json
The dynamic document property is then used in the Disk v2 operation: matchWildcard parameter.
That is it! Your Boomi test process and your local test script share the same test data.
IMPORTANT: It is important that you execute the process on your local ATOM, please. A cloud or a customer ATOM normally does not have access to your local disk drive and folder!