Sync docs from 1.0.x to gh-pages

This commit is contained in:
buildmaster
2017-02-10 12:56:32 +00:00
parent daaff23282
commit a6d7d24c24

View File

@@ -6842,6 +6842,12 @@ be of the same type as the type defined in the body of the response in the contr
<code>byType</code> can take a closure where you can set <code>minOccurrence</code> and <code>maxOccurrence</code>.
That way you can assert on the size of the collection.</p>
</li>
<li>
<p><code>byCommand(&#8230;&#8203;)</code> - the value taken from the response via the provided JSON Path will be
passed as an input to the custom method that you&#8217;re providing. E.g. <code>byCommand('foo($it)')</code>
will result in calling a <code>foo</code> method to which the value matching the JSON Path will get
passed.</p>
</li>
</ul>
</div>
<div class="paragraph">
@@ -6940,6 +6946,8 @@ That way you can assert on the size of the collection.</p>
// results in verification of size of array (max 0)
maxOccurrence(0)
})
// will execute a method `assertThatValueIsANumber`
jsonPath('$.duck', byCommand('assertThatValueIsANumber($it)'))
}
headers {
contentType(applicationJson())
@@ -7014,7 +7022,12 @@ assertions and the one from matchers with an <code>and</code> section):</p>
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()).isBetween(1, 3);</code></pre>
assertThat(parsedJson.read("$.valueWithMinMax", java.util.Collection.class).size()).isBetween(1, 3);
assertThat((Object) parsedJson.read("$.valueWithMinEmpty")).isInstanceOf(java.util.List.class);
assertThat(parsedJson.read("$.valueWithMinEmpty", java.util.Collection.class).size()).isGreaterThanOrEqualTo(0);
assertThat((Object) parsedJson.read("$.valueWithMaxEmpty")).isInstanceOf(java.util.List.class);
assertThat(parsedJson.read("$.valueWithMaxEmpty", java.util.Collection.class).size()).isLessThanOrEqualTo(0);
assertThatValueIsANumber(parsedJson.read("$.duck"));</code></pre>
</div>
</div>
<div class="paragraph">