fix(接口自动化): 导入jmx 初始化body内容
This commit is contained in:
parent
d13fa2193a
commit
db997d7578
|
@ -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);
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue