@@ -42,12 +42,12 @@ public void testMultipart() throws Exception {
42
42
Unirest .post (MockServer .POST )
43
43
.field ("name" , "Mark" )
44
44
.field ("funky" ,"bunch" )
45
- .field ("file" , rezFile ("/test" ))
45
+ .field ("file" , rezFile ("/test.txt " ))
46
46
.asObject (RequestCapture .class )
47
47
.getBody ()
48
48
.assertParam ("name" , "Mark" )
49
49
.assertMultiPartContentType ()
50
- .getFile ("test" )
50
+ .getFile ("test.txt " )
51
51
.assertBody ("This is a test file" )
52
52
.assertFileType ("application/octet-stream" );
53
53
}
@@ -83,7 +83,7 @@ public void testMultipartContentType() {
83
83
84
84
@ Test
85
85
public void canSendRawInputStreamsWithoutAFileName () throws Exception {
86
- FileInputStream stream = new FileInputStream (rezFile ("/test" ));
86
+ FileInputStream stream = new FileInputStream (rezFile ("/test.txt " ));
87
87
88
88
Unirest .post (MockServer .POST )
89
89
.field ("file" , stream )
@@ -126,11 +126,11 @@ public void testMultipartInputStreamContentType() throws Exception {
126
126
public void testMultipartInputStreamContentTypeAsync () throws Exception {
127
127
Unirest .post (MockServer .POST )
128
128
.field ("name" , "Mark" )
129
- .field ("file" , new FileInputStream (rezFile ("/test" )), ContentType .APPLICATION_OCTET_STREAM , "test" )
129
+ .field ("file" , new FileInputStream (rezFile ("/test.txt " )), ContentType .APPLICATION_OCTET_STREAM , "test.txt " )
130
130
.asJsonAsync (new MockCallback <>(this , r -> parse (r )
131
131
.assertParam ("name" , "Mark" )
132
132
.assertMultiPartContentType ()
133
- .getFile ("test" )
133
+ .getFile ("test.txt " )
134
134
.assertFileType ("application/octet-stream" ))
135
135
);
136
136
@@ -153,16 +153,16 @@ public void testMultipartByteContentType() throws Exception {
153
153
154
154
@ Test
155
155
public void testMultipartByteContentTypeAsync () throws Exception {
156
- final byte [] bytes = getFileBytes ("/test" );
156
+ final byte [] bytes = getFileBytes ("/test.txt " );
157
157
158
158
Unirest .post (MockServer .POST )
159
159
.field ("name" , "Mark" )
160
- .field ("file" , bytes , "test" )
160
+ .field ("file" , bytes , "test.txt " )
161
161
.asJsonAsync (new MockCallback <>(this , r ->
162
162
parse (r )
163
163
.assertParam ("name" , "Mark" )
164
164
.assertMultiPartContentType ()
165
- .getFile ("test" )
165
+ .getFile ("test.txt " )
166
166
.assertFileType ("application/octet-stream" ))
167
167
);
168
168
@@ -175,12 +175,12 @@ public void testMultipartByteContentTypeAsync() throws Exception {
175
175
public void testMultipartAsync () throws Exception {
176
176
Unirest .post (MockServer .POST )
177
177
.field ("name" , "Mark" )
178
- .field ("file" , rezFile ("/test" ))
178
+ .field ("file" , rezFile ("/test.txt " ))
179
179
.asJsonAsync (new MockCallback <>(this , r ->
180
180
parse (r )
181
181
.assertParam ("name" , "Mark" )
182
182
.assertMultiPartContentType ()
183
- .getFile ("test" )
183
+ .getFile ("test.txt " )
184
184
.assertFileType ("application/octet-stream" )
185
185
.assertBody ("This is a test file" ))
186
186
);
@@ -302,21 +302,21 @@ public void multiPartInputStreamAsFile() throws FileNotFoundException {
302
302
@ Test
303
303
public void testPostMulipleFIles () {
304
304
RequestCapture cap = Unirest .post (MockServer .POST )
305
- .field ("name" , asList (rezFile ("/test" ), rezFile ("/test2" )))
305
+ .field ("name" , asList (rezFile ("/test.txt " ), rezFile ("/test2.txt " )))
306
306
.asObject (RequestCapture .class )
307
307
.getBody ()
308
308
.assertMultiPartContentType ();
309
309
310
- cap .getFile ("test" ).assertBody ("This is a test file" );
311
- cap .getFile ("test2" ).assertBody ("this is another test" );
310
+ cap .getFile ("test.txt " ).assertBody ("This is a test file" );
311
+ cap .getFile ("test2.txt " ).assertBody ("this is another test" );
312
312
}
313
313
314
314
@ Test
315
315
public void testPostMultipleFiles ()throws Exception {
316
316
Unirest .post (MockServer .POST )
317
317
.field ("param3" , "wot" )
318
- .field ("file1" , rezFile ("/test" ))
319
- .field ("file2" , rezFile ("/test" ))
318
+ .field ("file1" , rezFile ("/test.txt " ))
319
+ .field ("file2" , rezFile ("/test.txt " ))
320
320
.asObject (RequestCapture .class )
321
321
.getBody ()
322
322
.assertMultiPartContentType ()
@@ -330,7 +330,7 @@ public void testPostBinaryUTF8() throws Exception {
330
330
Unirest .post (MockServer .POST )
331
331
.header ("Accept" , ContentType .MULTIPART_FORM_DATA .getMimeType ())
332
332
.field ("param3" , "こんにちは" )
333
- .field ("file" , rezFile ("/test" ))
333
+ .field ("file" , rezFile ("/test.txt " ))
334
334
.asObject (RequestCapture .class )
335
335
.getBody ()
336
336
.assertMultiPartContentType ()
@@ -341,7 +341,7 @@ public void testPostBinaryUTF8() throws Exception {
341
341
@ Test
342
342
public void testMultipeInputStreams () throws FileNotFoundException {
343
343
Unirest .post (MockServer .POST )
344
- .field ("name" , asList (new FileInputStream (rezFile ("/test" )), new FileInputStream (rezFile ("/test2" ))))
344
+ .field ("name" , asList (new FileInputStream (rezFile ("/test.txt " )), new FileInputStream (rezFile ("/test2.txt " ))))
345
345
.asObject (RequestCapture .class )
346
346
.getBody ()
347
347
.assertMultiPartContentType ()
@@ -353,7 +353,7 @@ public void testMultipeInputStreams() throws FileNotFoundException {
353
353
public void multiPartInputStream () throws FileNotFoundException {
354
354
Unirest .post (MockServer .POST )
355
355
.field ("foo" , "bar" )
356
- .field ("filecontents" , new FileInputStream (rezFile ("/test" )), ContentType .WILDCARD )
356
+ .field ("filecontents" , new FileInputStream (rezFile ("/test.txt " )), ContentType .WILDCARD )
357
357
.asObject (RequestCapture .class )
358
358
.getBody ()
359
359
.assertMultiPartContentType ()
@@ -401,7 +401,7 @@ public void rawInspection() {
401
401
String body = Unirest .post (MockServer .ECHO_RAW )
402
402
.field ("marky" ,"mark" )
403
403
.field ("funky" ,"bunch" )
404
- .field ("file" , rezFile ("/test" ))
404
+ .field ("file" , rezFile ("/test.txt " ))
405
405
.asString ()
406
406
.getBody ();
407
407
0 commit comments