REST API operations are implemented by subflows, and the OpenAPI document for the REST API
describes the input and output messages that are used by each operation.
You can generate a test case for an individual message flow node in a REST API operation subflow,
by following these steps:
Procedure
In the Application Development view of the Toolkit, open the REST API operation subflow
that contains the node that you want to test, right-click the node, and then click Create
Test Case.
The Create test case dialog is displayed, containing a read-only
preview of the generated test case.
The OpenAPI document defines the message format used by each operation, and an instance of the
message is generated and used to create the message assembly in the test case.
The node to be tested (in this case a Mapping node) is
specified in the SpyObjectReference object in the generated test case, as shown in
the following example:
// Define the SpyObjectReference
SpyObjectReference nodeReference = new SpyObjectReference().application("CustomerDatabaseV1").messageFlow("gen.CustomerDatabaseV1").subflowNode("getCustomer (Implementation)").node("Mapping");
If you generate a test case for a whole subflow, no node is specified in the
SpyObjectReference object definition:
// Define the SpyObjectReference
SpyObjectReference nodeReference = new SpyObjectReference().application("CustomerDatabaseV1").messageFlow("gen.CustomerDatabaseV1").node("getCustomer (Implementation)");