assertTrue
Validates an expression to be of type boolean
true
. An optional failureMessage
can be given for displaying should the validation fails.
assertTrue(expression)
# Or
assertTrue(expression, failureMessage)
#
Parametersexpression
: An expression that must evaluate to aboolean
failureMessage
: An optionalstring
message to show when validation fails
#
Returns- No value
#
ExampleassertTrue(!false && length([1]) > 0 && containsKey({name: 'Bo'}, 'name'))
assertTrue(nonEmpty(' '), 'Given string is empty')