@@ -59,15 +59,15 @@ public CurlRequestSnippetTests(String name, TemplateFormat templateFormat) {
5959 @ Test
6060 public void getRequest () throws IOException {
6161 this .snippets .expectCurlRequest ().withContents (
62- codeBlock ("bash" ).content ("$ curl 'http://localhost/foo' -i" ));
62+ codeBlock ("bash" ).content ("$ curl 'http://localhost/foo' -i -X GET " ));
6363 new CurlRequestSnippet (this .commandFormatter )
6464 .document (this .operationBuilder .request ("http://localhost/foo" ).build ());
6565 }
6666
6767 @ Test
6868 public void getRequestWithParameter () throws IOException {
69- this .snippets .expectCurlRequest ().withContents (
70- codeBlock ( "bash" ) .content ("$ curl 'http://localhost/foo?a=alpha' -i" ));
69+ this .snippets .expectCurlRequest ().withContents (codeBlock ( "bash" )
70+ .content ("$ curl 'http://localhost/foo?a=alpha' -i -X GET " ));
7171 new CurlRequestSnippet (this .commandFormatter ).document (this .operationBuilder
7272 .request ("http://localhost/foo" ).param ("a" , "alpha" ).build ());
7373 }
@@ -83,15 +83,15 @@ public void nonGetRequest() throws IOException {
8383 @ Test
8484 public void requestWithContent () throws IOException {
8585 this .snippets .expectCurlRequest ().withContents (codeBlock ("bash" )
86- .content ("$ curl 'http://localhost/foo' -i -d 'content'" ));
86+ .content ("$ curl 'http://localhost/foo' -i -X GET - d 'content'" ));
8787 new CurlRequestSnippet (this .commandFormatter ).document (this .operationBuilder
8888 .request ("http://localhost/foo" ).content ("content" ).build ());
8989 }
9090
9191 @ Test
9292 public void getRequestWithQueryString () throws IOException {
9393 this .snippets .expectCurlRequest ().withContents (codeBlock ("bash" )
94- .content ("$ curl 'http://localhost/foo?param=value' -i" ));
94+ .content ("$ curl 'http://localhost/foo?param=value' -i -X GET " ));
9595 new CurlRequestSnippet (this .commandFormatter ).document (this .operationBuilder
9696 .request ("http://localhost/foo?param=value" ).build ());
9797 }
@@ -100,7 +100,7 @@ public void getRequestWithQueryString() throws IOException {
100100 public void getRequestWithTotallyOverlappingQueryStringAndParameters ()
101101 throws IOException {
102102 this .snippets .expectCurlRequest ().withContents (codeBlock ("bash" )
103- .content ("$ curl 'http://localhost/foo?param=value' -i" ));
103+ .content ("$ curl 'http://localhost/foo?param=value' -i -X GET " ));
104104 new CurlRequestSnippet (this .commandFormatter ).document (
105105 this .operationBuilder .request ("http://localhost/foo?param=value" )
106106 .param ("param" , "value" ).build ());
@@ -110,7 +110,7 @@ public void getRequestWithTotallyOverlappingQueryStringAndParameters()
110110 public void getRequestWithPartiallyOverlappingQueryStringAndParameters ()
111111 throws IOException {
112112 this .snippets .expectCurlRequest ().withContents (codeBlock ("bash" )
113- .content ("$ curl 'http://localhost/foo?a=alpha&b=bravo' -i" ));
113+ .content ("$ curl 'http://localhost/foo?a=alpha&b=bravo' -i -X GET " ));
114114 new CurlRequestSnippet (this .commandFormatter )
115115 .document (this .operationBuilder .request ("http://localhost/foo?a=alpha" )
116116 .param ("a" , "alpha" ).param ("b" , "bravo" ).build ());
@@ -119,15 +119,15 @@ public void getRequestWithPartiallyOverlappingQueryStringAndParameters()
119119 @ Test
120120 public void getRequestWithDisjointQueryStringAndParameters () throws IOException {
121121 this .snippets .expectCurlRequest ().withContents (codeBlock ("bash" )
122- .content ("$ curl 'http://localhost/foo?a=alpha&b=bravo' -i" ));
122+ .content ("$ curl 'http://localhost/foo?a=alpha&b=bravo' -i -X GET " ));
123123 new CurlRequestSnippet (this .commandFormatter ).document (this .operationBuilder
124124 .request ("http://localhost/foo?a=alpha" ).param ("b" , "bravo" ).build ());
125125 }
126126
127127 @ Test
128128 public void getRequestWithQueryStringWithNoValue () throws IOException {
129- this .snippets .expectCurlRequest ().withContents (
130- codeBlock ( "bash" ) .content ("$ curl 'http://localhost/foo?param' -i" ));
129+ this .snippets .expectCurlRequest ().withContents (codeBlock ( "bash" )
130+ .content ("$ curl 'http://localhost/foo?param' -i -X GET " ));
131131 new CurlRequestSnippet (this .commandFormatter ).document (
132132 this .operationBuilder .request ("http://localhost/foo?param" ).build ());
133133 }
@@ -242,8 +242,8 @@ public void putRequestWithUrlEncodedParameter() throws IOException {
242242
243243 @ Test
244244 public void requestWithHeaders () throws IOException {
245- this .snippets .expectCurlRequest ()
246- . withContents ( codeBlock ("bash" ).content ("$ curl 'http://localhost/foo' -i"
245+ this .snippets .expectCurlRequest (). withContents (
246+ codeBlock ("bash" ).content ("$ curl 'http://localhost/foo' -i -X GET "
247247 + " -H 'Content-Type: application/json' -H 'a: alpha'" ));
248248 new CurlRequestSnippet (this .commandFormatter ).document (this .operationBuilder
249249 .request ("http://localhost/foo" )
@@ -254,8 +254,8 @@ public void requestWithHeaders() throws IOException {
254254 @ Test
255255 public void requestWithHeadersMultiline () throws IOException {
256256 this .snippets .expectCurlRequest ()
257- .withContents (codeBlock ("bash" )
258- . content ( String .format ("$ curl 'http://localhost/foo' -i \\ %n"
257+ .withContents (codeBlock ("bash" ). content (
258+ String .format ("$ curl 'http://localhost/foo' -i -X GET \\ %n"
259259 + " -H 'Content-Type: application/json' \\ %n"
260260 + " -H 'a: alpha'" )));
261261 new CurlRequestSnippet (CliDocumentation .multiLineFormat ())
@@ -267,8 +267,8 @@ public void requestWithHeadersMultiline() throws IOException {
267267
268268 @ Test
269269 public void requestWithCookies () throws IOException {
270- this .snippets .expectCurlRequest ()
271- . withContents ( codeBlock ("bash" ).content ("$ curl 'http://localhost/foo' -i"
270+ this .snippets .expectCurlRequest (). withContents (
271+ codeBlock ("bash" ).content ("$ curl 'http://localhost/foo' -i -X GET "
272272 + " --cookie 'name1=value1;name2=value2'" ));
273273 new CurlRequestSnippet (this .commandFormatter )
274274 .document (this .operationBuilder .request ("http://localhost/foo" )
@@ -336,7 +336,7 @@ public void multipartPostWithParameters() throws IOException {
336336 @ Test
337337 public void basicAuthCredentialsAreSuppliedUsingUserOption () throws IOException {
338338 this .snippets .expectCurlRequest ().withContents (codeBlock ("bash" )
339- .content ("$ curl 'http://localhost/foo' -i -u 'user:secret'" ));
339+ .content ("$ curl 'http://localhost/foo' -i -u 'user:secret' -X GET " ));
340340 new CurlRequestSnippet (this .commandFormatter ).document (this .operationBuilder
341341 .request ("http://localhost/foo" )
342342 .header (HttpHeaders .AUTHORIZATION ,
@@ -363,10 +363,9 @@ public void customAttributes() throws IOException {
363363
364364 @ Test
365365 public void customHostHeaderIsIncluded () throws IOException {
366- this .snippets .expectCurlRequest ()
367- .withContents (codeBlock ("bash" ).content (
368- "$ curl 'http://localhost/foo' -i" + " -H 'Host: api.example.com'"
369- + " -H 'Content-Type: application/json' -H 'a: alpha'" ));
366+ this .snippets .expectCurlRequest ().withContents (codeBlock ("bash" ).content (
367+ "$ curl 'http://localhost/foo' -i -X GET -H 'Host: api.example.com'"
368+ + " -H 'Content-Type: application/json' -H 'a: alpha'" ));
370369 new CurlRequestSnippet (this .commandFormatter ).document (this .operationBuilder
371370 .request ("http://localhost/foo" )
372371 .header (HttpHeaders .HOST , "api.example.com" )
0 commit comments