Adding an option to validate children nodes in an array (#219)

without this change it's impossible to assert with response matchers all elements of an array
with this change we're using AssertJs conditions in case the pattern contains [*]

fixes #217
This commit is contained in:
Marcin Grzejszczak
2017-02-08 11:41:59 +01:00
committed by GitHub
parent 8449382110
commit ab7fe13aac
7 changed files with 154 additions and 10 deletions

View File

@@ -342,7 +342,7 @@ assertions and the one from matchers with an `and` section):
assertThat((Object) parsedJson.read("$.valueWithMax")).isInstanceOf(java.util.List.class);
assertThat(parsedJson.read("$.valueWithMax", java.util.Collection.class).size()).isLessThanOrEqualTo(3);
assertThat((Object) parsedJson.read("$.valueWithMinMax")).isInstanceOf(java.util.List.class);
assertThat(parsedJson.read("$.valueWithMinMax", java.util.Collection.class).size()).isStrictlyBetween(1, 3);
assertThat(parsedJson.read("$.valueWithMinMax", java.util.Collection.class).size()).isBetween(1, 3);
----
and the WireMock stub like this: