refactor(接口测试): 优化执行时选择资源池的逻辑
This commit is contained in:
parent
bf69e72c58
commit
1ca47f0481
|
@ -393,14 +393,14 @@ public class ApiExecuteService {
|
|||
// 查询接口默认资源池
|
||||
ProjectApplication resourcePoolConfig = projectApplicationService.getByType(projectId, ProjectApplicationType.API.API_RESOURCE_POOL_ID.name());
|
||||
// 没有配置接口默认资源池
|
||||
if (resourcePoolConfig == null || StringUtils.isBlank(resourcePoolConfig.getTypeValue())) {
|
||||
Map<String, Object> configMap = new HashMap<>();
|
||||
projectApplicationService.putResourcePool(projectId, configMap, "apiTest");
|
||||
if (MapUtils.isEmpty(configMap)) {
|
||||
throw new MSException(ApiResultCode.EXECUTE_RESOURCE_POOL_NOT_CONFIG);
|
||||
}
|
||||
return (String) configMap.get(ProjectApplicationType.API.API_RESOURCE_POOL_ID.name());
|
||||
Map<String, Object> configMap = new HashMap<>();
|
||||
if (resourcePoolConfig != null && StringUtils.isNotBlank(resourcePoolConfig.getTypeValue())) {
|
||||
configMap.put(ProjectApplicationType.API.API_RESOURCE_POOL_ID.name(), resourcePoolConfig.getTypeValue());
|
||||
}
|
||||
return StringUtils.isBlank(resourcePoolConfig.getTypeValue()) ? null : resourcePoolConfig.getTypeValue();
|
||||
projectApplicationService.putResourcePool(projectId, configMap, "apiTest");
|
||||
if (MapUtils.isEmpty(configMap)) {
|
||||
throw new MSException(ApiResultCode.EXECUTE_RESOURCE_POOL_NOT_CONFIG);
|
||||
}
|
||||
return (String) configMap.get(ProjectApplicationType.API.API_RESOURCE_POOL_ID.name());
|
||||
}
|
||||
}
|
|
@ -63,6 +63,14 @@ public class MsDocumentAssertionElement {
|
|||
* 在执行时组装数据用
|
||||
*/
|
||||
private String jsonPath;
|
||||
/**
|
||||
* 分组id
|
||||
*/
|
||||
private String groupId;
|
||||
/**
|
||||
* 跨行数
|
||||
*/
|
||||
private int rowspan;
|
||||
|
||||
/**
|
||||
* 文档断言类型
|
||||
|
|
Loading…
Reference in New Issue