Use Test Data
Good practices for the use of test data
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.
Get test data
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.
Four files containing test data pasted from a Boomi execution.
Use test data when testing
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.
final TestFilesHelper _testFiles =
new TestFilesHelper( "testData", _sourceUri)

Share local test data with Boomi Integration
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:
Generic 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.

Last updated