fix(接口自动化): 修复端口是变量的问题

This commit is contained in:
fit2-zhao 2021-03-30 15:52:25 +08:00
parent 22b63d03df
commit 6db8a133de
2 changed files with 6 additions and 5 deletions

View File

@ -130,7 +130,7 @@ public class MsHTTPSamplerProxy extends MsTestElement {
}
// 1.8 之前历史数据
if(StringUtils.isEmpty(this.getProjectId()) && config.getConfig()!= null && !config.getConfig().isEmpty()){
if (StringUtils.isEmpty(this.getProjectId()) && config.getConfig() != null && !config.getConfig().isEmpty()) {
this.setProjectId("historyProjectID");
}
@ -154,10 +154,11 @@ public class MsHTTPSamplerProxy extends MsTestElement {
}
URL urlObject = new URL(url);
sampler.setDomain(URLDecoder.decode(urlObject.getHost(), "UTF-8"));
if (urlObject.getPort() > 0 && urlObject.getPort() != 10990 && StringUtils.isNotEmpty(this.getPort()) && this.getPort().startsWith("${")) {
sampler.setPort(urlObject.getPort());
} else {
if (urlObject.getPort() > 0 && urlObject.getPort() == 10990 && StringUtils.isNotEmpty(this.getPort()) && this.getPort().startsWith("${")) {
sampler.setProperty("HTTPSampler.port", this.getPort());
} else {
sampler.setPort(urlObject.getPort());
}
sampler.setProtocol(urlObject.getProtocol());
sampler.setPath(urlObject.getPath());

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