Skip to content

Commit 17815e3

Browse files
deploy: 760d150
1 parent 2947035 commit 17815e3

123 files changed

Lines changed: 6530 additions & 1257 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

GraphQL/customized-graphql-urls/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204
"type" : "Snippet"
205205
} ]
206206
} ],
207-
"lastModifiedTime" : 1671557712797,
207+
"lastModifiedTime" : 1677178162240,
208208
"tocItem" : {
209209
"chapterTitle" : "GraphQL",
210210
"pageTitle" : "Customized Graphql Urls",

GraphQL/introduction/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@
160160
}
161161
},
162162
"paths" : [ ],
163+
"anchorId" : "server-response",
163164
"type" : "Json"
164165
} ]
165166
} ],
@@ -188,6 +189,7 @@
188189
}
189190
},
190191
"paths" : [ ],
192+
"anchorId" : "server-response-2",
191193
"type" : "Json"
192194
} ]
193195
} ],
@@ -272,7 +274,7 @@
272274
} ]
273275
} ]
274276
} ],
275-
"lastModifiedTime" : 1671557712797,
277+
"lastModifiedTime" : 1677178162240,
276278
"tocItem" : {
277279
"chapterTitle" : "GraphQL",
278280
"pageTitle" : "Introduction",

GraphQL/queries-and-mutations/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@
281281
} ]
282282
} ]
283283
} ],
284-
"lastModifiedTime" : 1671557712797,
284+
"lastModifiedTime" : 1677178162240,
285285
"tocItem" : {
286286
"chapterTitle" : "GraphQL",
287287
"pageTitle" : "Queries And Mutations",

GraphQL/report/index.html

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

HTTP/CRUD-separated/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
</div><section style="max-width: 640px; margin-left: auto; margin-right: auto;">
8686
<article>
8787
<header><h1>HTTP Calls Separation</h1></header>
88-
<p>Groovy One of the benefits of separating one CRUD scenario into multiple is to be able to run one test at a time. In order to make each test runnable independently we will use createLazyResource . package scenarios.rest.springboot import static org.testingisdocumenting.webtau.WebTauGroovyDsl.* def customerPayload = [firstName: &quot;FN&quot;, lastName: &quot;LN&quot;] def customer = createLazyResource(&quot;customer&quot;) { // lazy resource to be created on the first access def id = http.post(&quot;/customers&quot;, customerPayload) { return id } return new Customer(id: id, url: &quot;/customers/${id}&quot;) // definition is below } scenario(&quot;customer create&quot;) { customer.id.should != null // accessing resource for the first time will trigger POST (in this example) } scenario(&quot;customer read&quot;) { http.get(customer.url) { // convenient re-use of url defined above body.should == customerPayload } } scenario(&quot;customer update&quot;) { def changedLastName = &quot;NLN&quot; http.put(customer.url, [*:customerPayload, lastName: changedLastName]) { lastName.should == changedLastName } http.get(customer.url) { lastName.should == changedLastName } } scenario(&quot;customer delete&quot;) { http.delete(customer.url) { statusCode.should == 204 } http.get(customer.url) { statusCode.should == 404 } } package scenarios.rest.springboot class Customer { Number id String url // store url of the created entity } Note: to run one scenario at a time use sscenario (additional s in front). groovy-standalone-runner/selective-run Read more Java One of the benefits of separating one CRUD @Test into multiple is to be able to run one test at a time. In order to make each test runnable independently we will leverage BeforeAll , AfterAll , and TestMethodOrder . package com.example.tests.junit5; import org.testingisdocumenting.webtau.http.request.HttpRequestBody; import org.testingisdocumenting.webtau.junit5.WebTau; import org.junit.jupiter.api.*; import static org.testingisdocumenting.webtau.WebTauDsl.*; @WebTau @TestMethodOrder(MethodOrderer.OrderAnnotation.class) // forcing methods execution order @DisplayName(&quot;customer CRUD&quot;) public class CustomerCrudSeparatedJavaTest { private static final HttpRequestBody customerPayload = http.json( &quot;firstName&quot;, &quot;FN&quot;, &quot;lastName&quot;, &quot;LN&quot;); private static final HttpRequestBody changedCustomerPayload = http.json( &quot;firstName&quot;, &quot;FN&quot;, &quot;lastName&quot;, &quot;NLN&quot;); private static int id; @BeforeAll @DisplayName(&quot;create customer&quot;) // optional friendly name for reporting purposes public static void createCustomer() { id = http.post(&quot;/customers&quot;, customerPayload, ((header, body) -&gt; { return body.get(&quot;id&quot;); })); actual(id).shouldNot(equal(0)); } @Test @Order(1) @DisplayName(&quot;read customer&quot;) public void read() { http.get(&quot;/customers/&quot; + id, ((header, body) -&gt; { body.should(equal(customerPayload)); })); } @Test @Order(2) // order dependence saves from creating customer on every test @DisplayName(&quot;update customer&quot;) public void update() { http.put(&quot;/customers/&quot; + id, changedCustomerPayload, ((header, body) -&gt; { body.should(equal(changedCustomerPayload)); })); http.get(&quot;/customers/&quot; + id, ((header, body) -&gt; { body.should(equal(changedCustomerPayload)); })); } @Test @Order(3) // but you can still run each method independently @DisplayName(&quot;delete customer&quot;) public void delete() { http.delete(&quot;/customers/&quot; + id, ((header, body) -&gt; { header.statusCode.should(equal(204)); })); http.get(&quot;/customers/&quot; + id, ((header, body) -&gt; { header.statusCode.should(equal(404)); })); id = -1; // marking as deleted to let cleanup step know that no delete is required } @AfterAll public static void cleanup() { // optional (since we create new ids all the time) step to keep your environment clean if (id == -1) { return; } http.delete(&quot;/customers/&quot; + id); } }</p>
88+
<p>Groovy One of the benefits of separating one CRUD scenario into multiple is to be able to run one test at a time. In order to make each test runnable independently we will use createLazyResource . package scenarios.rest.springboot import static org.testingisdocumenting.webtau.WebTauGroovyDsl.* def customerPayload = [firstName: &quot;FN&quot;, lastName: &quot;LN&quot;] def customer = createLazyResource(&quot;customer&quot;) { // lazy resource to be created on the first access def id = http.post(&quot;/customers&quot;, customerPayload) { return id } return new Customer(id: id, url: &quot;/customers/${id}&quot;) // definition is below } scenario(&quot;customer create&quot;) { customer.id.should != null // accessing resource for the first time will trigger POST (in this example) } scenario(&quot;customer read&quot;) { http.get(customer.url) { // convenient re-use of url defined above body.should == customerPayload } } scenario(&quot;customer update&quot;) { def changedLastName = &quot;NLN&quot; http.put(customer.url, [*:customerPayload, lastName: changedLastName]) { lastName.should == changedLastName } http.get(customer.url) { lastName.should == changedLastName } } scenario(&quot;customer delete&quot;) { http.delete(customer.url) { statusCode.should == 204 } http.get(customer.url) { statusCode.should == 404 } } package scenarios.rest.springboot class Customer { Number id String url // store url of the created entity } Note: to run one scenario at a time use sscenario (additional s in front). groovy-standalone-runner/selective-run Read more Java One of the benefits of separating one CRUD @Test into multiple is to be able to run one test at a time. In order to make each test runnable independently we will leverage BeforeAll , AfterAll , and TestMethodOrder . package com.example.tests.junit5; import org.testingisdocumenting.webtau.http.request.HttpRequestBody; import org.testingisdocumenting.webtau.junit5.WebTau; import org.junit.jupiter.api.*; import static org.testingisdocumenting.webtau.WebTauDsl.*; @WebTau // annotation to enable rich console output and html reporting @TestMethodOrder(MethodOrderer.OrderAnnotation.class) // forcing methods execution order @DisplayName(&quot;customer CRUD&quot;) public class CustomerCrudSeparatedJavaTest { private static final HttpRequestBody customerPayload = http.json( &quot;firstName&quot;, &quot;FN&quot;, &quot;lastName&quot;, &quot;LN&quot;); private static final HttpRequestBody changedCustomerPayload = http.json( &quot;firstName&quot;, &quot;FN&quot;, &quot;lastName&quot;, &quot;NLN&quot;); private static int id; @BeforeAll @DisplayName(&quot;create customer&quot;) // optional friendly name for reporting purposes public static void createCustomer() { id = http.post(&quot;/customers&quot;, customerPayload, ((header, body) -&gt; { return body.get(&quot;id&quot;); })); actual(id).shouldNot(equal(0)); } @Test @Order(1) @DisplayName(&quot;read customer&quot;) public void read() { http.get(&quot;/customers/&quot; + id, ((header, body) -&gt; { body.should(equal(customerPayload)); })); } @Test @Order(2) // order dependence saves from creating customer on every test @DisplayName(&quot;update customer&quot;) public void update() { http.put(&quot;/customers/&quot; + id, changedCustomerPayload, ((header, body) -&gt; { body.should(equal(changedCustomerPayload)); })); http.get(&quot;/customers/&quot; + id, ((header, body) -&gt; { body.should(equal(changedCustomerPayload)); })); } @Test @Order(3) // but you can still run each method independently @DisplayName(&quot;delete customer&quot;) public void delete() { http.delete(&quot;/customers/&quot; + id, ((header, body) -&gt; { header.statusCode.should(equal(204)); })); http.get(&quot;/customers/&quot; + id, ((header, body) -&gt; { header.statusCode.should(equal(404)); })); id = -1; // marking as deleted to let cleanup step know that no delete is required } @AfterAll public static void cleanup() { // optional (since we create new ids all the time) step to keep your environment clean if (id == -1) { return; } http.delete(&quot;/customers/&quot; + id); } }</p>
8989
</article>
9090

9191
<article>
@@ -230,7 +230,7 @@
230230
} ]
231231
}, {
232232
"lang" : "java",
233-
"snippet" : "package com.example.tests.junit5;\n\nimport org.testingisdocumenting.webtau.http.request.HttpRequestBody;\nimport org.testingisdocumenting.webtau.junit5.WebTau;\nimport org.junit.jupiter.api.*;\n\nimport static org.testingisdocumenting.webtau.WebTauDsl.*;\n\n@WebTau\n@TestMethodOrder(MethodOrderer.OrderAnnotation.class) // forcing methods execution order\n@DisplayName(\"customer CRUD\")\npublic class CustomerCrudSeparatedJavaTest {\n private static final HttpRequestBody customerPayload = http.json(\n \"firstName\", \"FN\",\n \"lastName\", \"LN\");\n\n private static final HttpRequestBody changedCustomerPayload = http.json(\n \"firstName\", \"FN\",\n \"lastName\", \"NLN\");\n\n private static int id;\n\n @BeforeAll\n @DisplayName(\"create customer\") // optional friendly name for reporting purposes\n public static void createCustomer() {\n id = http.post(\"/customers\", customerPayload, ((header, body) -> {\n return body.get(\"id\");\n }));\n\n actual(id).shouldNot(equal(0));\n }\n\n @Test\n @Order(1)\n @DisplayName(\"read customer\")\n public void read() {\n http.get(\"/customers/\" + id, ((header, body) -> {\n body.should(equal(customerPayload));\n }));\n }\n\n @Test\n @Order(2) // order dependence saves from creating customer on every test\n @DisplayName(\"update customer\")\n public void update() {\n http.put(\"/customers/\" + id, changedCustomerPayload, ((header, body) -> {\n body.should(equal(changedCustomerPayload));\n }));\n\n http.get(\"/customers/\" + id, ((header, body) -> {\n body.should(equal(changedCustomerPayload));\n }));\n }\n\n @Test\n @Order(3) // but you can still run each method independently\n @DisplayName(\"delete customer\")\n public void delete() {\n http.delete(\"/customers/\" + id, ((header, body) -> {\n header.statusCode.should(equal(204));\n }));\n\n http.get(\"/customers/\" + id, ((header, body) -> {\n header.statusCode.should(equal(404));\n }));\n\n id = -1; // marking as deleted to let cleanup step know that no delete is required\n }\n\n @AfterAll\n public static void cleanup() { // optional (since we create new ids all the time) step to keep your environment clean\n if (id == -1) {\n return;\n }\n\n http.delete(\"/customers/\" + id);\n }\n}",
233+
"snippet" : "package com.example.tests.junit5;\n\nimport org.testingisdocumenting.webtau.http.request.HttpRequestBody;\nimport org.testingisdocumenting.webtau.junit5.WebTau;\nimport org.junit.jupiter.api.*;\n\nimport static org.testingisdocumenting.webtau.WebTauDsl.*;\n\n@WebTau // annotation to enable rich console output and html reporting\n@TestMethodOrder(MethodOrderer.OrderAnnotation.class) // forcing methods execution order\n@DisplayName(\"customer CRUD\")\npublic class CustomerCrudSeparatedJavaTest {\n private static final HttpRequestBody customerPayload = http.json(\n \"firstName\", \"FN\",\n \"lastName\", \"LN\");\n\n private static final HttpRequestBody changedCustomerPayload = http.json(\n \"firstName\", \"FN\",\n \"lastName\", \"NLN\");\n\n private static int id;\n\n @BeforeAll\n @DisplayName(\"create customer\") // optional friendly name for reporting purposes\n public static void createCustomer() {\n id = http.post(\"/customers\", customerPayload, ((header, body) -> {\n return body.get(\"id\");\n }));\n\n actual(id).shouldNot(equal(0));\n }\n\n @Test\n @Order(1)\n @DisplayName(\"read customer\")\n public void read() {\n http.get(\"/customers/\" + id, ((header, body) -> {\n body.should(equal(customerPayload));\n }));\n }\n\n @Test\n @Order(2) // order dependence saves from creating customer on every test\n @DisplayName(\"update customer\")\n public void update() {\n http.put(\"/customers/\" + id, changedCustomerPayload, ((header, body) -> {\n body.should(equal(changedCustomerPayload));\n }));\n\n http.get(\"/customers/\" + id, ((header, body) -> {\n body.should(equal(changedCustomerPayload));\n }));\n }\n\n @Test\n @Order(3) // but you can still run each method independently\n @DisplayName(\"delete customer\")\n public void delete() {\n http.delete(\"/customers/\" + id, ((header, body) -> {\n header.statusCode.should(equal(204));\n }));\n\n http.get(\"/customers/\" + id, ((header, body) -> {\n header.statusCode.should(equal(404));\n }));\n\n id = -1; // marking as deleted to let cleanup step know that no delete is required\n }\n\n @AfterAll\n public static void cleanup() { // optional (since we create new ids all the time) step to keep your environment clean\n if (id == -1) {\n return;\n }\n\n http.delete(\"/customers/\" + id);\n }\n}",
234234
"commentsType" : "inline",
235235
"type" : "Snippet"
236236
} ]
@@ -285,14 +285,14 @@
285285
}, {
286286
"fit" : true,
287287
"imageSrc" : "/webtau/doc-artifacts/reports/report-crud-separated-http-calls.png",
288-
"timestamp" : 1671558351421,
288+
"timestamp" : 1677178900589,
289289
"shapes" : [ ],
290290
"width" : 1310.0,
291291
"height" : 802.0,
292292
"type" : "AnnotatedImage"
293293
} ]
294294
} ],
295-
"lastModifiedTime" : 1671557712797,
295+
"lastModifiedTime" : 1677178162240,
296296
"tocItem" : {
297297
"chapterTitle" : "HTTP",
298298
"pageTitle" : "CRUD Separated",

HTTP/CRUD/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211
"fit" : true,
212212
"annotate" : false,
213213
"imageSrc" : "/webtau/doc-artifacts/reports/report-crud-http-calls.png",
214-
"timestamp" : 1671558349525,
214+
"timestamp" : 1677178898681,
215215
"shapes" : [ ],
216216
"width" : 1310.0,
217217
"height" : 802.0,
@@ -224,7 +224,7 @@
224224
} ]
225225
} ]
226226
} ],
227-
"lastModifiedTime" : 1671557712797,
227+
"lastModifiedTime" : 1677178162240,
228228
"tocItem" : {
229229
"chapterTitle" : "HTTP",
230230
"pageTitle" : "CRUD",

HTTP/HTTP-calls/index.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@
264264
"amount" : 30
265265
},
266266
"paths" : [ "root.price" ],
267+
"anchorId" : "overloaded-calls-get-query-response",
267268
"type" : "Json"
268269
} ]
269270
}, {
@@ -489,6 +490,7 @@
489490
"amount" : 30
490491
},
491492
"paths" : [ "root.price" ],
493+
"anchorId" : "get-get-query-response",
492494
"type" : "Json"
493495
}, {
494496
"tabsContent" : [ {
@@ -718,6 +720,7 @@
718720
"status" : "SUCCESS"
719721
},
720722
"paths" : [ "root.status" ],
723+
"anchorId" : "post-post-chat-response",
721724
"type" : "Json"
722725
}, {
723726
"tabsContent" : [ {
@@ -962,6 +965,7 @@
962965
"status" : "SUCCESS"
963966
},
964967
"paths" : [ "root.status" ],
968+
"anchorId" : "put-put-chat-id1-response",
965969
"type" : "Json"
966970
}, {
967971
"tabsContent" : [ {
@@ -1184,6 +1188,7 @@
11841188
"status" : "SUCCESS"
11851189
},
11861190
"paths" : [ "root.status" ],
1191+
"anchorId" : "delete-delete-chat-id1-response",
11871192
"type" : "Json"
11881193
}, {
11891194
"tabsContent" : [ {
@@ -1413,6 +1418,7 @@
14131418
"status" : "SUCCESS"
14141419
},
14151420
"paths" : [ "root.status" ],
1421+
"anchorId" : "patch-patch-chat-id1-response",
14161422
"type" : "Json"
14171423
}, {
14181424
"tabsContent" : [ {
@@ -1723,7 +1729,7 @@
17231729
"type" : "Tabs"
17241730
} ]
17251731
} ],
1726-
"lastModifiedTime" : 1671557712797,
1732+
"lastModifiedTime" : 1677178162240,
17271733
"tocItem" : {
17281734
"chapterTitle" : "HTTP",
17291735
"pageTitle" : "HTTP Calls",

HTTP/JSON-schema/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@
185185
}
186186
},
187187
"paths" : [ ],
188+
"anchorId" : "validation-correct-schema-for-the-example-above",
188189
"type" : "Json"
189190
} ]
190191
}, {
@@ -223,6 +224,7 @@
223224
}
224225
},
225226
"paths" : [ ],
227+
"anchorId" : "error-messages-incorrect-schema-for-the-example-above",
226228
"type" : "Json"
227229
} ]
228230
}, {
@@ -266,7 +268,7 @@
266268
"type" : "Snippet"
267269
} ]
268270
} ],
269-
"lastModifiedTime" : 1671557712797,
271+
"lastModifiedTime" : 1677178162240,
270272
"tocItem" : {
271273
"chapterTitle" : "HTTP",
272274
"pageTitle" : "JSON Schema",

0 commit comments

Comments
 (0)