Skip to content

Commit

Permalink
Merge branch 'master' into issue-601
Browse files Browse the repository at this point in the history
  • Loading branch information
authorjapps authored Jan 22, 2024
2 parents 6b2a67a + 8527d1d commit 574610c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static void buildOtherRequestParams(Map<String, Object> fileFieldNameValu
if (entry.getKey().equals(FILES_FIELD) || entry.getKey().equals(BOUNDARY_FIELD)) {
continue;
}
multipartEntityBuilder.addPart(entry.getKey(), new StringBody((String) entry.getValue(), TEXT_PLAIN));
multipartEntityBuilder.addPart(entry.getKey(), new StringBody(entry.getValue().toString(), TEXT_PLAIN));
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package org.jsmart.zerocode.core.utils;

import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.jsmart.zerocode.core.httpclient.utils.FileUploadUtils;
import org.junit.Test;

import java.util.LinkedHashMap;
import java.util.Map;

import static org.junit.Assert.fail;

public class FileUploadUtilsTest {

@Test
public void buildOtherRequestParamsTest1() {
Map<String, Object> fileFieldNameValueMapStub = new LinkedHashMap<>();
fileFieldNameValueMapStub.put("name", "name");
fileFieldNameValueMapStub.put("fileName", "test.wav");
fileFieldNameValueMapStub.put("location", "location");
MultipartEntityBuilder multipartEntityBuilderStub = MultipartEntityBuilder.create();
try {
FileUploadUtils.buildOtherRequestParams(fileFieldNameValueMapStub, multipartEntityBuilderStub);
} catch (Exception e) {
fail("Should not have thrown any exception");
}
}
}

0 comments on commit 574610c

Please sign in to comment.