refactor(接口测试): 优化执行时选择资源池的逻辑

This commit is contained in:
wxg0103 2024-02-23 19:38:19 +08:00 committed by 刘瑞斌
parent bf69e72c58
commit 1ca47f0481
2 changed files with 16 additions and 8 deletions

View File

@ -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());
}
}

View File

@ -63,6 +63,14 @@ public class MsDocumentAssertionElement {
* 在执行时组装数据用
*/
private String jsonPath;
/**
* 分组id
*/
private String groupId;
/**
* 跨行数
*/
private int rowspan;
/**
* 文档断言类型