fix(接口测试): 环境配置host不生效
This commit is contained in:
parent
fd5ad458be
commit
b262b60c2c
|
@ -474,8 +474,13 @@ public class MsHTTPElementConverter extends AbstractJmeterElementConverter<MsHTT
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
String domain = httpConfig.getHostname().trim();
|
String domain = httpConfig.getHostname().trim();
|
||||||
|
int index = domain.indexOf(":");
|
||||||
|
if (index > -1) {
|
||||||
|
domain = domain.substring(0, index);
|
||||||
|
}
|
||||||
|
|
||||||
List<Host> hosts = new ArrayList<>();
|
List<Host> hosts = new ArrayList<>();
|
||||||
envConfig.getConfig().getHostConfig().getHosts().forEach(host -> {
|
for (Host host : envConfig.getConfig().getHostConfig().getHosts()) {
|
||||||
if (StringUtils.isNotBlank(host.getDomain())) {
|
if (StringUtils.isNotBlank(host.getDomain())) {
|
||||||
String hostDomain = host.getDomain().trim().replace(HTTP, StringUtils.EMPTY).replace(HTTPS, StringUtils.EMPTY);
|
String hostDomain = host.getDomain().trim().replace(HTTP, StringUtils.EMPTY).replace(HTTPS, StringUtils.EMPTY);
|
||||||
if (StringUtils.equals(hostDomain, domain)) {
|
if (StringUtils.equals(hostDomain, domain)) {
|
||||||
|
@ -483,7 +488,8 @@ public class MsHTTPElementConverter extends AbstractJmeterElementConverter<MsHTT
|
||||||
hosts.add(host);
|
hosts.add(host);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(hosts)) {
|
if (CollectionUtils.isNotEmpty(hosts)) {
|
||||||
return dnsCacheManager(name + "DNSCacheManager", hosts);
|
return dnsCacheManager(name + "DNSCacheManager", hosts);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue