Sync docs from master to gh-pages

This commit is contained in:
buildmaster
2018-10-26 20:04:05 +00:00
parent d1a0cf52ba
commit 072790e9cd
3 changed files with 91 additions and 4 deletions

View File

@@ -188,6 +188,8 @@ relative to the folder in which the contract lays.</p></div><div class="section"
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// (this can be a valid request or invalid depending</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// on type of contract being specified).</span>
request {
method GET()
url <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"/foo"</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//...</span>
}
@@ -196,6 +198,7 @@ relative to the folder in which the contract lays.</p></div><div class="section"
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// with following response after receiving request</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// specified in "request" part above).</span>
response {
status <span class="hl-number">200</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//...</span>
}
@@ -224,6 +227,7 @@ same information is mandatory in request definition of the Contract.</p><p><b>Gr
response {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//...</span>
status <span class="hl-number">200</span>
}
}</pre><p>
</p><p><b>YAML.&nbsp;</b>
@@ -241,6 +245,7 @@ the recommended way, as doing so makes the tests <span class="strong"><strong>ho
response {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//...</span>
status <span class="hl-number">200</span>
}
}</pre><p>
</p><p><b>YAML.&nbsp;</b>
@@ -251,6 +256,7 @@ the recommended way, as doing so makes the tests <span class="strong"><strong>ho
</p><pre class="programlisting">org.springframework.cloud.contract.spec.Contract.make {
request {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//...</span>
method GET()
urlPath(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">'/users'</span>) {
@@ -287,6 +293,7 @@ the recommended way, as doing so makes the tests <span class="strong"><strong>ho
response {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//...</span>
status <span class="hl-number">200</span>
}
}</pre><p>
</p><p><b>YAML.&nbsp;</b>
@@ -346,6 +353,8 @@ response:
</p><pre class="programlisting">org.springframework.cloud.contract.spec.Contract.make {
request {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//...</span>
method GET()
url <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"/foo"</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// Each header is added in form `'Header-Name' : 'Header-Value'`.</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// there are also some helper methods</span>
@@ -359,6 +368,7 @@ response:
response {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//...</span>
status <span class="hl-number">200</span>
}
}</pre><p>
</p><p><b>YAML.&nbsp;</b>
@@ -371,6 +381,8 @@ headers:
</p><pre class="programlisting">org.springframework.cloud.contract.spec.Contract.make {
request {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//...</span>
method GET()
url <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"/foo"</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// Each Cookies is added in form `'Cookie-Key' : 'Cookie-Value'`.</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// there are also some helper methods</span>
@@ -384,6 +396,7 @@ headers:
response {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//...</span>
status <span class="hl-number">200</span>
}
}</pre><p>
</p><p><b>YAML.&nbsp;</b>
@@ -396,6 +409,8 @@ cookies:
</p><pre class="programlisting">org.springframework.cloud.contract.spec.Contract.make {
request {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//...</span>
method GET()
url <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"/foo"</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// Currently only JSON format of request body is supported.</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// Format will be determined from a header or body's content.</span>
@@ -404,6 +419,7 @@ cookies:
response {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//...</span>
status <span class="hl-number">200</span>
}
}</pre><p>
</p><p><b>YAML.&nbsp;</b>
@@ -495,6 +511,8 @@ following code shows an example:</p><p><b>Groovy DSL.&nbsp;</b>
</p><pre class="programlisting">org.springframework.cloud.contract.spec.Contract.make {
request {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//...</span>
method GET()
url <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"/foo"</span>
}
response {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// Status code sent by the server</span>
@@ -1090,6 +1108,7 @@ email, url, uuid, iso_date, iso_date_time, iso_time, iso_8601_with_offset, non_e
Content-Type: application/json
cookies:
foo: 2
bar: 3
queryParameters:
limit: 10
offset: 20
@@ -1117,7 +1136,7 @@ email, url, uuid, iso_date, iso_date_time, iso_time, iso_8601_with_offset, non_e
regex: /get/[0-9]
# predefined:
# execute a method
# command:
#command: 'equals($it)'
queryParameters:
- key: limit
type: equal_to
@@ -1142,6 +1161,8 @@ email, url, uuid, iso_date, iso_date_time, iso_time, iso_8601_with_offset, non_e
cookies:
- key: foo
regex: '[0-9]'
- key: bar
command: 'equals($it)'
headers:
- key: Content-Type
regex: "application/json.*"
@@ -1174,6 +1195,9 @@ email, url, uuid, iso_date, iso_date_time, iso_time, iso_8601_with_offset, non_e
type: by_null
response:
status: 200
cookies:
foo: 1
bar: 2
body:
duck: 123
alpha: "abc"
@@ -1205,6 +1229,11 @@ response:
headers:
- key: Content-Type
regex: "application/json.*"
cookies:
- key: foo
regex: '[0-9]'
- key: bar
command: 'equals($it)'
body:
- path: $.duck
type: by_regex