@@ -262,8 +262,8 @@ public void multipartPostWithNoSubmittedFileName() throws IOException {
262
262
.document (this .operationBuilder .request ("http://localhost/upload" ).method ("POST" )
263
263
.header (HttpHeaders .CONTENT_TYPE , MediaType .MULTIPART_FORM_DATA_VALUE )
264
264
.part ("metadata" , "{\" description\" : \" foo\" }" .getBytes ()).build ());
265
- String expectedContent = "$ http --form POST 'http://localhost/upload'"
266
- + " 'metadata'@<(echo '{\" description\" : \" foo\" }') " ;
265
+ String expectedContent = "$ http --multipart POST 'http://localhost/upload'"
266
+ + " 'metadata'= '{\" description\" : \" foo\" }'" ;
267
267
assertThat (this .generatedSnippets .httpieRequest ()).is (codeBlock ("bash" ).withContent (expectedContent ));
268
268
}
269
269
@@ -275,7 +275,7 @@ public void multipartPostWithContentType() throws IOException {
275
275
.part ("image" , new byte [0 ]).header (HttpHeaders .CONTENT_TYPE , MediaType .IMAGE_PNG_VALUE )
276
276
.submittedFileName ("documents/images/example.png" ).build ());
277
277
// httpie does not yet support manually set content type by part
278
- String expectedContent = "$ http --form POST 'http://localhost/upload'"
278
+ String expectedContent = "$ http --multipart POST 'http://localhost/upload'"
279
279
+ " 'image'@'documents/images/example.png'" ;
280
280
assertThat (this .generatedSnippets .httpieRequest ()).is (codeBlock ("bash" ).withContent (expectedContent ));
281
281
}
@@ -286,7 +286,7 @@ public void multipartPost() throws IOException {
286
286
.document (this .operationBuilder .request ("http://localhost/upload" ).method ("POST" )
287
287
.header (HttpHeaders .CONTENT_TYPE , MediaType .MULTIPART_FORM_DATA_VALUE )
288
288
.part ("image" , new byte [0 ]).submittedFileName ("documents/images/example.png" ).build ());
289
- String expectedContent = "$ http --form POST 'http://localhost/upload'"
289
+ String expectedContent = "$ http --multipart POST 'http://localhost/upload'"
290
290
+ " 'image'@'documents/images/example.png'" ;
291
291
assertThat (this .generatedSnippets .httpieRequest ()).is (codeBlock ("bash" ).withContent (expectedContent ));
292
292
}
@@ -298,7 +298,7 @@ public void multipartPostWithParameters() throws IOException {
298
298
.header (HttpHeaders .CONTENT_TYPE , MediaType .MULTIPART_FORM_DATA_VALUE )
299
299
.part ("image" , new byte [0 ]).submittedFileName ("documents/images/example.png" ).and ()
300
300
.param ("a" , "apple" , "avocado" ).param ("b" , "banana" ).build ());
301
- String expectedContent = "$ http --form POST 'http://localhost/upload'"
301
+ String expectedContent = "$ http --multipart POST 'http://localhost/upload'"
302
302
+ " 'image'@'documents/images/example.png' 'a=apple' 'a=avocado'" + " 'b=banana'" ;
303
303
assertThat (this .generatedSnippets .httpieRequest ()).is (codeBlock ("bash" ).withContent (expectedContent ));
304
304
}
@@ -310,8 +310,8 @@ public void multipartPostWithOverlappingPartsAndParameters() throws IOException
310
310
.header (HttpHeaders .CONTENT_TYPE , MediaType .MULTIPART_FORM_DATA_VALUE )
311
311
.part ("image" , new byte [0 ]).submittedFileName ("documents/images/example.png" ).and ()
312
312
.part ("a" , "apple" .getBytes ()).and ().param ("a" , "apple" ).build ());
313
- String expectedContent = "$ http --form POST 'http://localhost/upload'"
314
- + " 'image'@'documents/images/example.png' 'a'@<(echo 'apple') " ;
313
+ String expectedContent = "$ http --multipart POST 'http://localhost/upload'"
314
+ + " 'image'@'documents/images/example.png' 'a'= 'apple'" ;
315
315
assertThat (this .generatedSnippets .httpieRequest ()).is (codeBlock ("bash" ).withContent (expectedContent ));
316
316
}
317
317
0 commit comments