fix(接口自动化): 修复导入jmx数据源问题
This commit is contained in:
parent
5114672358
commit
eae9359892
|
@ -280,7 +280,9 @@ public class MsJmeterParser extends ApiImportAbstractParser<ScenarioImport> {
|
||||||
preCreate(hashTree);
|
preCreate(hashTree);
|
||||||
// 更新数据源
|
// 更新数据源
|
||||||
ApiTestEnvironmentService environmentService = CommonBeanFactory.getBean(ApiTestEnvironmentService.class);
|
ApiTestEnvironmentService environmentService = CommonBeanFactory.getBean(ApiTestEnvironmentService.class);
|
||||||
dataPools.getEnvConfig().setDatabaseConfigs(new ArrayList<>(dataPools.getDataSources().values()));
|
if (dataPools.getDataSources() != null) {
|
||||||
|
dataPools.getEnvConfig().setDatabaseConfigs(new ArrayList<>(dataPools.getDataSources().values()));
|
||||||
|
}
|
||||||
if (dataPools.getIsCreate()) {
|
if (dataPools.getIsCreate()) {
|
||||||
dataPools.getTestEnvironmentWithBLOBs().setConfig(JSON.toJSONString(dataPools.getEnvConfig()));
|
dataPools.getTestEnvironmentWithBLOBs().setConfig(JSON.toJSONString(dataPools.getEnvConfig()));
|
||||||
String id = environmentService.add(dataPools.getTestEnvironmentWithBLOBs());
|
String id = environmentService.add(dataPools.getTestEnvironmentWithBLOBs());
|
||||||
|
|
|
@ -5,6 +5,7 @@ import io.metersphere.api.dto.scenario.HttpConfig;
|
||||||
import io.metersphere.api.dto.scenario.TCPConfig;
|
import io.metersphere.api.dto.scenario.TCPConfig;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@ -13,4 +14,11 @@ public class EnvironmentConfig {
|
||||||
private HttpConfig httpConfig;
|
private HttpConfig httpConfig;
|
||||||
private List<DatabaseConfig> databaseConfigs;
|
private List<DatabaseConfig> databaseConfigs;
|
||||||
private TCPConfig tcpConfig;
|
private TCPConfig tcpConfig;
|
||||||
|
|
||||||
|
public EnvironmentConfig() {
|
||||||
|
this.commonConfig = new CommonConfig();
|
||||||
|
this.httpConfig = new HttpConfig();
|
||||||
|
this.databaseConfigs = new ArrayList<>();
|
||||||
|
this.tcpConfig = new TCPConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue