Merge remote-tracking branch 'origin/v1.8' into v1.8

This commit is contained in:
song.tianyang 2021-03-25 18:25:33 +08:00
commit dfc24d96a4
5 changed files with 12 additions and 9 deletions

View File

@ -17,7 +17,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<shiro.version>1.6.0</shiro.version>
<java.version>1.8</java.version>
<jmeter.version>5.2.1</jmeter.version>
<jmeter.version>5.4.1</jmeter.version>
<nacos.version>1.1.3</nacos.version>
<dubbo.version>2.7.8</dubbo.version>
<graalvm.version>20.1.0</graalvm.version>

View File

@ -136,8 +136,10 @@ public class MsJmeterParser extends ApiImportAbstractParser<ScenarioImport> {
try {
HTTPSamplerProxy source = (HTTPSamplerProxy) key;
BeanUtils.copyBean(samplerProxy, source);
samplerProxy.setRest(new ArrayList<KeyValue>(){{this.add(new KeyValue());}});
samplerProxy.setArguments(new ArrayList<KeyValue>(){{this.add(new KeyValue());}});
if (source != null && source.getHTTPFiles().length > 0) {
samplerProxy.getBody().setBinary(new ArrayList<>());
samplerProxy.getBody().initBinary();
samplerProxy.getBody().setType(Body.FORM_DATA);
List<KeyValue> keyValues = new LinkedList<>();
for (HTTPFileArg arg : source.getHTTPFiles()) {
@ -163,6 +165,7 @@ public class MsJmeterParser extends ApiImportAbstractParser<ScenarioImport> {
source.getArguments().getArgumentsAsMap().forEach((k, v) -> {
samplerProxy.getBody().setRaw(v);
});
samplerProxy.getBody().initKvs();
} else {
List<KeyValue> keyValues = new LinkedList<>();
source.getArguments().getArgumentsAsMap().forEach((k, v) -> {
@ -173,6 +176,7 @@ public class MsJmeterParser extends ApiImportAbstractParser<ScenarioImport> {
samplerProxy.setArguments(keyValues);
}
}
samplerProxy.getBody().initBinary();
}
samplerProxy.setPath("");
samplerProxy.setMethod(source.getMethod());

View File

@ -66,14 +66,11 @@ public class Body {
sampler.setDoMultipart(true);
}
} else {
if (!this.isJson()) {
sampler.setPostBodyRaw(true);
} else {
if (StringUtils.isNotEmpty(this.format) && "JSON-SCHEMA".equals(this.format) && this.getJsonSchema() != null) {
this.raw = JSONSchemaGenerator.getJson(com.alibaba.fastjson.JSON.toJSONString(this.getJsonSchema()));
}
if (StringUtils.isNotEmpty(this.format) && "JSON-SCHEMA".equals(this.format) && this.getJsonSchema() != null) {
this.raw = JSONSchemaGenerator.getJson(com.alibaba.fastjson.JSON.toJSONString(this.getJsonSchema()));
}
KeyValue keyValue = new KeyValue("", "JSON-SCHEMA", this.getRaw(), true, true);
sampler.setPostBodyRaw(true);
keyValue.setEnable(true);
keyValue.setEncode(false);
body.add(keyValue);

View File

@ -0,0 +1,2 @@
-- api_scenario_report modify column length
ALTER TABLE api_scenario_report MODIFY COLUMN name VARCHAR(300);

@ -1 +1 @@
Subproject commit 2115bd28a90854d2b6276a90878934715498c584
Subproject commit 07951ba17aef6f29e50cfd68e40de3266f9a60cd