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')]"/>

startsWith(String)

Checks that the expression starts with the specified String.

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

endsWith(String)

Checks that the expression ends with the specified String.

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

isEmptyString()

Checks that the expression has zero length.

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

isEmptyOrNullString()

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

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

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')]"/>

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')]"/>

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'])]"/>