Add HTTP method option unconditionally in curl command

Closes gh-488
This commit is contained in:
Johnny Lim
2018-03-26 21:58:53 +09:00
committed by Andy Wilkinson
parent 95c4234c99
commit da64c55fce
5 changed files with 34 additions and 37 deletions

View File

@@ -121,7 +121,7 @@ public class RestAssuredRestDocumentationIntegrationTests {
"build/generated-snippets/curl-snippet-with-cookies/curl-request.adoc"),
is(snippet(asciidoctor()).withContents(codeBlock(asciidoctor(), "bash")
.content(String.format("$ curl 'http://localhost:"
+ tomcat.getPort() + "/' -i \\%n"
+ tomcat.getPort() + "/' -i -X GET \\%n"
+ " -H 'Accept: application/json' \\%n"
+ " -H 'Content-Type: " + contentType + "' \\%n"
+ " --cookie 'cookieName=cookieVal'")))));

View File

@@ -120,7 +120,7 @@ public class RestAssuredRestDocumentationIntegrationTests {
"build/generated-snippets/curl-snippet-with-cookies/curl-request.adoc"),
is(snippet(asciidoctor()).withContents(codeBlock(asciidoctor(), "bash")
.content(String.format("$ curl 'http://localhost:"
+ tomcat.getPort() + "/' -i \\%n"
+ tomcat.getPort() + "/' -i -X GET \\%n"
+ " -H 'Accept: application/json' \\%n"
+ " -H 'Content-Type: " + contentType + "' \\%n"
+ " --cookie 'cookieName=cookieVal'")))));