fix(接口测试): 修复 post url 格式不对的问题

This commit is contained in:
Captain.B 2020-08-19 17:39:40 +08:00
parent bf414059fa
commit f1b8bf4c9f
1 changed files with 7 additions and 2 deletions

View File

@ -149,9 +149,14 @@ public class JmeterDocumentParser {
String path = ele.getTextContent();
Map<String, String> parser = parserUrl(path);
String url = parser.get("URL");
String params = parser.keySet().stream().filter(k -> !"URL".equals(k)).reduce("", (u, k) -> {
String params = parser.keySet().stream().filter(k -> !"URL".equals(k)).reduce("?", (u, k) -> {
String v = parser.get(k);
u += "&" + k + "=" + ScriptEngineUtils.calculate(v);
if ("?".equals(u)) {
u += "";
} else {
u += "&";
}
u += k + "=" + ScriptEngineUtils.calculate(v);
return u;
});
ele.setTextContent(url + params);