fix(接口定义): 修复接口自动化中自定义请求域名用变量的情况下,认证配置不生效的缺陷

--bug=1016601 --user=王孝刚 【接口测试】github#17678,接口自动化中自定义请求域名用变量的情况下,认证配置不生效
https://www.tapd.cn/55049933/s/1239577
This commit is contained in:
wxg0103 2022-09-06 16:48:22 +08:00 committed by f2c-ci-robot[bot]
parent 0a35673ad1
commit 45b771f0ff
1 changed files with 2 additions and 11 deletions

View File

@ -68,16 +68,7 @@ public class MsAuthManager extends MsTestElement {
ParameterConfig config = (ParameterConfig) msParameter; ParameterConfig config = (ParameterConfig) msParameter;
AuthManager authManager = initBase(); AuthManager authManager = initBase();
Authorization auth = new Authorization(); Authorization auth = new Authorization();
if (this.url != null) { auth.setURL("");
auth.setURL(this.url);
} else {
if (config != null && config.isEffective(this.getProjectId())) {
if (config.isEffective(this.getProjectId())) {
String url = config.getConfig().get(this.getProjectId()).getHttpConfig().getProtocol() + "://" + config.getConfig().get(this.getProjectId()).getHttpConfig().getSocket();
auth.setURL(url);
}
}
}
auth.setUser(this.username); auth.setUser(this.username);
auth.setPass(this.password); auth.setPass(this.password);
auth.setMechanism(mechanismMap.get(this.getVerification())); auth.setMechanism(mechanismMap.get(this.getVerification()));
@ -90,7 +81,7 @@ public class MsAuthManager extends MsTestElement {
try { try {
AuthManager authManager = initBase(); AuthManager authManager = initBase();
Authorization auth = new Authorization(); Authorization auth = new Authorization();
auth.setURL(samplerProxy.getProtocol() + "://" + samplerProxy.getDomain()); auth.setURL("");
auth.setUser(msAuthManager.getUsername()); auth.setUser(msAuthManager.getUsername());
auth.setPass(msAuthManager.getPassword()); auth.setPass(msAuthManager.getPassword());
auth.setMechanism(mechanismMap.get(msAuthManager.getVerification())); auth.setMechanism(mechanismMap.get(msAuthManager.getVerification()));