refactor(接口测试): 跨项目证书配置隔离开
Signed-off-by: fit2-zhao <yong.zhao@fit2cloud.com>
This commit is contained in:
parent
a580bd0a9e
commit
f9a33bf35d
|
@ -135,10 +135,10 @@ public class MsHTTPSamplerProxy extends MsTestElement {
|
||||||
}
|
}
|
||||||
sampler.setProperty(TestElement.TEST_CLASS, HTTPSamplerProxy.class.getName());
|
sampler.setProperty(TestElement.TEST_CLASS, HTTPSamplerProxy.class.getName());
|
||||||
sampler.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("HttpTestSampleGui"));
|
sampler.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("HttpTestSampleGui"));
|
||||||
String resourceId = ElementUtil.setBaseParams(sampler, this.getParent(), config, this.getId(), this.getIndex());
|
String keystoreId = ElementUtil.setBaseParams(sampler, this.getParent(), config, this.getId(), this.getIndex());
|
||||||
resourceId = StringUtils.isNotBlank(config.getReportId()) ? config.getReportId() : resourceId;
|
keystoreId = StringUtils.isNotBlank(config.getReportId()) ? config.getReportId() + "_" + keystoreId : keystoreId;
|
||||||
LogUtil.info("设置SSL证书配置{}", resourceId);
|
LogUtil.info("设置SSL证书配置{}", keystoreId);
|
||||||
sampler.setProperty("MS-KEYSTORE-ID", resourceId);
|
sampler.setProperty("MS-KEYSTORE-ID", keystoreId);
|
||||||
|
|
||||||
sampler.setMethod(this.getMethod());
|
sampler.setMethod(this.getMethod());
|
||||||
sampler.setContentEncoding(StandardCharsets.UTF_8.name());
|
sampler.setContentEncoding(StandardCharsets.UTF_8.name());
|
||||||
|
@ -237,7 +237,7 @@ public class MsHTTPSamplerProxy extends MsTestElement {
|
||||||
if (this.authManager != null && MsAuthManager.mechanismMap.containsKey(this.authManager.getVerification())) {
|
if (this.authManager != null && MsAuthManager.mechanismMap.containsKey(this.authManager.getVerification())) {
|
||||||
this.authManager.setAuth(httpSamplerTree, this.authManager, sampler);
|
this.authManager.setAuth(httpSamplerTree, this.authManager, sampler);
|
||||||
}
|
}
|
||||||
addCertificate(config, httpSamplerTree, resourceId);
|
addCertificate(config, httpSamplerTree, keystoreId);
|
||||||
if (httpConfig != null) {
|
if (httpConfig != null) {
|
||||||
//根据配置增加全局前后至脚本
|
//根据配置增加全局前后至脚本
|
||||||
JMeterScriptUtil.setScriptByHttpConfig(httpConfig, httpSamplerTree, config, useEnvironment, this.getEnvironmentId(), false);
|
JMeterScriptUtil.setScriptByHttpConfig(httpConfig, httpSamplerTree, config, useEnvironment, this.getEnvironmentId(), false);
|
||||||
|
|
Loading…
Reference in New Issue