StringifiedJson
Transformation matcher that matches a JSON.stringify()ed version of the given object.
For example, if the actual data is the string:
"{\"foo\":2}"
then you could match it with:
StringifiedJson({
"foo": 2
})
or
StringifiedJson({
"foo": AnyNumber(2)
})
- Typescript
- Java
import { matchers } from '@contract-case/case-definition-dsl'
new matchers.strings.StringifiedJson(child: any)
Parameters
Name | Type | Description |
---|---|---|
child | any | The object or matcher that matches the decoded. |
import io.contract_testing.contractcase.definitions.matchers.strings.StringifiedJson;
new StringifiedJson(java.lang.Object child);
Parameters
Name | Type | Description |
---|---|---|
child | java.lang.Object | The object or matcher that matches the decoded. |