@@ -79,18 +79,22 @@ public final void after() throws IllegalStateException, IOException {
7979 @ Test
8080 public final void givenFileandMultipleTextParts_whenUploadwithAddPart_thenNoExceptions () throws IOException {
8181 final URL url = Thread .currentThread ().getContextClassLoader ().getResource ("uploads/" + TEXTFILENAME );
82+
8283 final File file = new File (url .getPath ());
8384 final FileBody fileBody = new FileBody (file , ContentType .DEFAULT_BINARY );
8485 final StringBody stringBody1 = new StringBody ("This is message 1" , ContentType .MULTIPART_FORM_DATA );
8586 final StringBody stringBody2 = new StringBody ("This is message 2" , ContentType .MULTIPART_FORM_DATA );
87+ //
8688 final MultipartEntityBuilder builder = MultipartEntityBuilder .create ();
8789 builder .setMode (HttpMultipartMode .BROWSER_COMPATIBLE );
8890 builder .addPart ("upfile" , fileBody );
8991 builder .addPart ("text1" , stringBody1 );
9092 builder .addPart ("text2" , stringBody2 );
9193 final HttpEntity entity = builder .build ();
94+ //
9295 post .setEntity (entity );
9396 response = client .execute (post );
97+
9498 final int statusCode = response .getStatusLine ().getStatusCode ();
9599 final String responseString = getContent ();
96100 final String contentTypeInHeader = getContentTypeHeader ();
@@ -124,7 +128,7 @@ public final void givenFileandTextPart_whenUploadwithAddBinaryBodyandAddTextBody
124128 }
125129
126130 @ Test
127- public final void givenFileandInputStreamandText_whenUploadwithAddBinaryBodyandAddTextBody_ThenNoException () throws ClientProtocolException , IOException {
131+ public final void givenFileAndInputStreamandText_whenUploadwithAddBinaryBodyandAddTextBody_ThenNoException () throws ClientProtocolException , IOException {
128132 final URL url = Thread .currentThread ().getContextClassLoader ().getResource ("uploads/" + ZIPFILENAME );
129133 final URL url2 = Thread .currentThread ().getContextClassLoader ().getResource ("uploads/" + IMAGEFILENAME );
130134 final InputStream inputStream = new FileInputStream (url .getPath ());
0 commit comments