fix(接口自动化): 修复导入jmx数据源问题
This commit is contained in:
parent
5114672358
commit
eae9359892
|
@ -280,7 +280,9 @@ public class MsJmeterParser extends ApiImportAbstractParser<ScenarioImport> {
|
|||
preCreate(hashTree);
|
||||
// 更新数据源
|
||||
ApiTestEnvironmentService environmentService = CommonBeanFactory.getBean(ApiTestEnvironmentService.class);
|
||||
if (dataPools.getDataSources() != null) {
|
||||
dataPools.getEnvConfig().setDatabaseConfigs(new ArrayList<>(dataPools.getDataSources().values()));
|
||||
}
|
||||
if (dataPools.getIsCreate()) {
|
||||
dataPools.getTestEnvironmentWithBLOBs().setConfig(JSON.toJSONString(dataPools.getEnvConfig()));
|
||||
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 lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
|
@ -13,4 +14,11 @@ public class EnvironmentConfig {
|
|||
private HttpConfig httpConfig;
|
||||
private List<DatabaseConfig> databaseConfigs;
|
||||
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