Chapter 8. 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.

Note

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

  1. Set the column type first (use a field whose type is a list or a map).
  2. Double click a cell in the column to input a value.
  3. To create the list values for the data objects in the collection editor popup:

    1. Select Create List.
    2. Click Add new item.
    3. Enter the required value and click the check icon dmn datatype constraints tickmark to save each collection item that you add.
    4. Click Save.
    5. To edit an item from the collection, click the pencil icon in the collection popup editor.
    6. Click Save changes.
    7. To delete an item from the collection, click the bin icon in the collection popup editor.
  4. To define the list values for the data objects in the collection editor popup:

    1. Select Define List.
    2. 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.

    3. Click Save.
  5. To create the map values for the data objects in the collection editor popup:

    1. Select Create Map.
    2. Click Add new item.
    3. Enter the required value and click the check icon dmn datatype constraints tickmark to save each collection item that you add.
    4. Click Save.
    5. To edit an item from the collection, click the pencil icon in the collection popup editor.
    6. Click Save changes.
    7. To delete an item from the collection, click the bin icon in the collection popup editor.
  6. To define the map values for the data objects in the collection editor popup:

    1. Select Define Map.
    2. 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.

    3. Click Save.

      Note

      To 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.

  7. Click Remove to delete the entire collection.