%dw 2.0
import dw::tests::Asserts
---
payload must beObject()
dw::test::Asserts
This module contains the set of core matchers to use in your tests.
Functions
anyOf
beGreaterThan
beGreaterThan(expected: Comparable, inclusive: Boolean = false): Matcher<Comparable>
Validates that the asserted Comparable
value is greater than the given one.
The value can be equal when using the inclusive argument.
Parameters
Name | Description |
---|---|
|
The number to compare to. |
|
Specifies if the comparison is inclusive or not (Optional). False by default. |
beLowerThan
beLowerThan(expected: Comparable, inclusive: Boolean = false): Matcher<Comparable>
Validates that the asserted Comparable
value is less than the given value.
The value can be equal when using the inclusive argument.
Parameters
Name | Description |
---|---|
|
The number to compare to. |
|
Specifies if the comparison is inclusive or not (Optional). False by default. |
beOneOf
contain
contain(expected: String): Matcher<String>
Validates that the asserted string contains the given string.
eachItem
endWith
equalTo
equalToResource
equalToResource(resourceName: String, contentType: String = "application/dw", readerProperties: Object = {}): Matcher<Any>
Validates that the given value is equal to the content of a resource file.
The resource file must belong to the classpath.
haveItem
haveSize
must
must<T>(value: T, matchExpressions: Array<(value: T) → Matcher<T> | MatcherResult | Boolean>): MatcherResult
This function enables you to assert a value with with a list of matchers or expressions.