Operation Tests

A number of operations support a tests structure which provides an easy-to-use mechanism for flows to perform checks on the results associated with each operation.

Operations which support a built-in tests array include the following:

The tests structure for each of these is identical. It is an array of Operation Test Objects each with the following attributes. Note that all attributes in the tests array may be expressions. Use curly braces to request expression expansion, e.g. { 'A' . 'B' }.

Common Attributes

Attribute Type Description
.kpath String [Required] This is the "kpath" which locates the response element which is to be validated by this check. Refer to the KPath documentation for more information on KPath syntax. Refer to the documentation for each operation for more information on the structure of the response object which can be accessed by the KPath.
.type String [Required] The type of test to perform. Supported test types are string, integer, regex, timestamp, size, ordered_str_array.

Each type of Operation Test has additional parameters.

String Test Attributes


Attribute Type Description
.value String [Required] For a string test, you must specify the expected value to check against the actual returned value matched by the KPath. To check that a returned string is not present, specify null for the expected value.
.abort_on_fail Integer If abort_on_fail is = 1 then failure to match this Operation Test will abort the Flow Execution. (Default = 0).

Integer Test Attributes

Attribute Type Description
.value Integer [Required] For a integer test, you must specify the expected value to check against the actual returned value matched by the KPath. To check that a returned integer is not present, specify null for the expected value.

RegEx Test Attributes

Attribute Type Description
.pattern Integer [Required] For a regex test, you must specify the expected pattern to check against the actual returned value matched by the KPath. To check that a returned value is not present, specify null for the expected pattern.

Note that pattern matching is always case-sensitive.

Timestamp Test Attributes

Attribute Type Description
.value String [Required] For a timestamp test, you must specify the expected value to check against the actual returned value matched by the KPath. To check that a returned timestamp is not present, specify null for the expected value.

All timestamps are in 14 character YYYYMMDDHHMMSS format or in SOAP format YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DDTHH:MM:SS. The specified value for a timestamp Operation Test may be either:

In either case, a "leeway" value in seconds may also be given - allowing for a "fuzzy" match.

Examples:

Size Test Attributes

Attribute Type Description
.size Integer [Required] For a size test, you must specify the expected size of the ARRAY element that will be matched by the KPath.

Note that for a size test, an actual ARRAY value match by the KPath will have value equal to the number of array elements it contains. An undefined value has actual size = 0. A SCALAR or OBJECT value matched by the KPath is considered to have actual size = 1.

Ordered String Array Test Attributes

Attribute Type Description
.value Array of Strings [Required] For an ordered_str_array test, the expected value is an ARRAY of STRING values which must each match exactly the actual response values in number, sequence and value.