Hear from Salesforce leaders on how to create and deploy Agentforce agents.
Contact Us 1-800-596-4880

String Matchers Reference

containsString(String)

Checks that the expression contains the specified String.

Example
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::containsString('example')]"/>
xml

startsWith(String)

Checks that the expression starts with the specified String.

Example
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::startsWith('exam')]"/>
xml

endsWith(String)

Checks that the expression ends with the specified String.

Example
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::endsWith('ple')]"/>
xml

isEmptyString()

Checks that the expression has zero length.

Example
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::isEmptyString()]"/>
xml

isEmptyOrNullString()

Checks that the expression is null, or has zero length.

Example
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::isEmptyOrNullString()]"/>
xml

equalToIgnoringCase(String)

Checks that the expression is equal to the specified String, ignoring case.

Example
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::equalToIgnoringCase('example')]"/>
xml

equalToIgnoringWhiteSpace(String)

Checks that the expression is equal to the string disregarding leading and trailing white spaces, and compression all inner white spaces to a single space.

Example
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::equalToIgnoringWhiteSpace('An Example')]"/>
xml

stringContainsInOrder(Array<String>)

Checks that the expression contains all of the specified substrings, regardless of the order of their appearance.

Example
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::stringContainsInOrder(['an', 'example'])]"/>
xml