Chapter 68. Using list and map collections in test scenarios
The test scenarios designer supports list and map collections for both DMN-based as well as rules-based test scenarios. You can create and define a collection like a list or a map as the value of a particular cell in both GIVEN and EXPECT columns.
For map entries, an entry key must be a String
data type.
To pass the parameter in the EXPECT column of Rule-based collection editor use the actualValue
keyword whereas use the ?
keyword in DMN-based test scenario.
Procedure
- Set the column type first (use a field whose type is a list or a map).
- Double click a cell in the column to input a value.
To create the list values for the data objects in the collection editor popup:
- Select Create List.
- Click Add new item.
-
Enter the required value and click the check icon
to save each collection item that you add.
- Click Save.
- To edit an item from the collection, click the pencil icon in the collection popup editor.
- Click Save changes.
- To delete an item from the collection, click the bin icon in the collection popup editor.
To define the list values for the data objects in the collection editor popup:
- Select Define List.
Use the MVEL or FEEL expression to define a list value in the text field.
Rule-based test scenario uses MVEL expression language and DMN-based test scenario uses FEEL expression language.
- Click Save.
To create the map values for the data objects in the collection editor popup:
- Select Create Map.
- Click Add new item.
-
Enter the required value and click the check icon
to save each collection item that you add.
- Click Save.
- To edit an item from the collection, click the pencil icon in the collection popup editor.
- Click Save changes.
- To delete an item from the collection, click the bin icon in the collection popup editor.
To define the map values for the data objects in the collection editor popup:
- Select Define Map.
Use the MVEL or FEEL expression to define a map value in the text field.
Rule-based test scenario uses MVEL expression language and DMN-based test scenario uses FEEL expression language.
Click Save.
NoteTo define the map values for DMN-based test scenario, you can add a fact and use the FEEL expression, instead of using the collection editor.
- Click Remove to delete the entire collection.