Test Cases
Discover how to build effective test scenarios for different integration cases.
Last updated
Was this helpful?
Discover how to build effective test scenarios for different integration cases.
Last updated
Was this helpful?
A Test Case is a configuration that includes a defined set of inputs, conditions, and expected outcomes used to verify that a specific integration pipeline is working as intended. Test cases are especially useful for ensuring the quality of your integrations and documenting the expected behavior of your flows.
They allow you to:
Simulate various input conditions.
Mock connector responses.
Automatically compare actual and expected results.
In the sidebar on Canvas, go to Flow.
Click Create a new test case.
When creating a test case, you must configure the elements that define the test scenario:
The payload represents the input data for your test. When adding a payload, provide the following:
Name: A name for the payload.
Description: A short description explaining the context or purpose of the payload.
Mock responses let you simulate connector outputs, which is helpful when validating flows under different conditions. When adding a mock response, provide the following:
Connector: The connector whose response you want to mock.
JSON: The simulated response, in JSON format.
Name: A name for the mock response.
Description: A brief explanation of the scenario represented by this mock.
To simulate more connectors, click Add more mocks.
The expected result defines what the output of the flow should be after execution. It’s used to compare the actual result with the expected one.
Provide the following:
Operator: The comparison operator to be used. Currently the only available option is Equals.
JSONPath: The JSONPath expression pointing to the result field.
Value: The expected value, in JSON format.
Once all required information has been provided, click Save.
The test case will then appear in the left sidebar under the Flow section. From there, you can click the three-dots icon to:
Edit: Modify the test case settings.
Remove: Delete the test case.
Duplicate: Make a copy of the test case.
Single Run: Execute the test case.
Open execution: Only available after the test case is executed.
To execute the test case:
Ensure the flow is connected to a trigger. If the flow isn’t connected, the test case won’t run.
In the sidebar, locate the test case and click the three-dots icon.
Select Single Run to start the execution.
The test will run, and the platform will compare the actual output with the expected result:
If it passes: A green success icon appears next to the test case name.
If it fails: A red failure icon appears next to the test case name.
To view the execution details on the Execution panel, click Open execution. More information can be found on the Results tab.
Use case: You want to ensure that a default birth date is added when the input JSON is missing.
This pipeline uses a single connector:
Transformer (JOLT) V2: Adds a default birth date if it’s missing from the input payload.
We’ll test this transformation using a test case with a sample input that lacks the birthDate
field.
We’ll use the default
operation to add a field when it doesn't already exist.
JOLT specification:
This spec checks if birthDate
exists under customer
. If not, it adds it with the default value ”01/01/1970”
.
We'll simulate a payload that contains only the name and SSN, and verify that the Transformer (JOLT) V2 connector adds the default birth date.
Payload:
Mock Response: (Leave empty for this example)
Expected result:
JSONPath: $.customer
Value:
After running the test case, the output is as follows:
This confirms that the test passed:
The Transformer (JOLT) V2 applied the default
operation as expected.
Since the original input didn’t include a birthDate
, the field was added with the default value ”01/01/1970”
.
Use case: You want to restructure product data returned from a database into a new format.
Objective: Group product details under a details
object and rename fields for better organization.
This pipeline uses the following connectors:
As we don’t have access to the actual database, we’ll simulate it using a test case with a mocked DB response.
We’ll use a JOLT shift
operation to map and reorganize the fields.
JOLT specification:
This spec renames id
to productId
and nests other fields under a details
object.
We'll simulate the database response and validate the transformation.
Payload: (Leave empty for this example)
Mock Response:
Connector: DB V2
JSON Payload:
Expected result:
JSONPath: $.details
Value:
After running the test case, the output is as follows:
This confirms that the test passed:
The Transformer (JOLT) V2 applied the specification correctly to restructure the input data.
Fields were renamed and nested under the details
object as intended.
The productId
field remained at the top level, while other attributes were grouped logically under details
.
JSON: The input data in JSON format. You can also reuse of the pipeline by clicking Load to edit.
Objective: Use the to add a default "birthDate": "01/01/1970"
field when it’s not present in the input.
: Retrieves product data.
: Reorganizes and renames the fields using the shift
operation.