fix(接口自动化): 导入jmx 初始化body内容

This commit is contained in:
fit2-zhao 2021-04-07 16:41:55 +08:00 committed by fit2-zhao
parent d13fa2193a
commit db997d7578
2 changed files with 12 additions and 0 deletions

View File

@ -198,6 +198,12 @@ public class MsJmeterParser extends ApiImportAbstractParser<ScenarioImport> {
samplerProxy.setArguments(new ArrayList<KeyValue>() {{
this.add(new KeyValue());
}});
// 初始化body
Body body = new Body();
body.init();
body.initKvs();
body.initBinary();
samplerProxy.setBody(body);
if (source != null && source.getHTTPFiles().length > 0) {
samplerProxy.getBody().initBinary();
samplerProxy.getBody().setType(Body.FORM_DATA);

View File

@ -116,6 +116,12 @@ public class Body {
return StringUtils.equals(type, XML);
}
public void init() {
this.type = "";
this.raw = "";
this.format = "";
}
public void initKvs() {
this.kvs = new ArrayList<>();
this.kvs.add(new KeyValue());