Assert size of collections on the request side; fixes gh-824

This commit is contained in:
Marcin Grzejszczak
2018-12-20 14:53:38 +01:00
parent 6969d233b8
commit 9c7c896115
21 changed files with 202 additions and 117 deletions

View File

@@ -821,7 +821,7 @@ match the regex for an ISO DateTime value.
the regex for an ISO Time value.
** `byType()`: The value taken from the producer's response via the provided JSON Path needs to be
of the same type as the type defined in the body of the response in the contract.
`byType` can take a closure, in which you can set `minOccurrence` and `maxOccurrence`.
`byType` can take a closure, in which you can set `minOccurrence` and `maxOccurrence`. For the request side, you should use the closure to assert size of the collection.
That way, you can assert the size of the flattened collection. To check the size of an
unflattened collection, use a custom method with the `byCommand(...)` testMatcher.
** `byCommand(...)`: The value taken from the producer's response via the provided JSON Path is
@@ -869,6 +869,8 @@ Below you can find the allowed list of `type`s.
** `by_date`
** `by_timestamp`
** `by_time`
** `by_type`
*** there are 2 additional fields accepted: `minOccurrence` and `maxOccurrence`.
* For `testMatchers`:
** `by_equality`
** `by_regex`