fix(接口测试): 场景执行模块匹配不上执行报错
This commit is contained in:
parent
50b96bbc97
commit
62197311ae
|
@ -21,14 +21,17 @@ import java.util.LinkedList;
|
|||
public abstract class AbstractMsTestElement implements MsTestElement {
|
||||
/**
|
||||
* 步骤ID(唯一)
|
||||
* 运行时设置
|
||||
*/
|
||||
private String stepId;
|
||||
/**
|
||||
* 关联的资源ID(用例ID/接口ID/场景ID)等
|
||||
* 运行时设置
|
||||
*/
|
||||
private String resourceId;
|
||||
/**
|
||||
* 当前的项目ID
|
||||
* 运行时设置
|
||||
*/
|
||||
private String projectId;
|
||||
/**
|
||||
|
|
|
@ -499,6 +499,7 @@ public class ApiExecuteService {
|
|||
apiCommonService.setEnableCommonScriptProcessorInfo(testElement);
|
||||
testElement.setResourceId(taskRequest.getResourceId());
|
||||
testElement.setStepId(taskRequest.getResourceId());
|
||||
testElement.setProjectId(taskRequest.getProjectId());
|
||||
return execute(runRequest, taskRequest, apiParamConfig);
|
||||
}
|
||||
|
||||
|
|
|
@ -597,6 +597,9 @@ public class ApiTestCaseService extends MoveNodeService {
|
|||
.collect(Collectors.toMap(ApiTestCase::getApiDefinitionId, ApiTestCase::getId));
|
||||
|
||||
List<String> definitionIds = apiCaseDefinitionMap.keySet().stream().collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(definitionIds)) {
|
||||
return List.of();
|
||||
}
|
||||
List<ApiResourceModuleInfo> moduleInfos = extApiDefinitionMapper.getModuleInfoByIds(definitionIds);
|
||||
// 将 resourceId 从定义ID替换成用例ID
|
||||
moduleInfos.forEach(moduleInfo ->
|
||||
|
|
Loading…
Reference in New Issue