fix: 部分接口缺少xpack代码报错
This commit is contained in:
parent
985a2c4936
commit
b287613efd
|
@ -1165,11 +1165,13 @@ public class ApiTestCaseService {
|
||||||
List<ApiTestCaseDTO> apiTestCaseDTOS = extApiTestCaseMapper.relevanceApiList(request);
|
List<ApiTestCaseDTO> apiTestCaseDTOS = extApiTestCaseMapper.relevanceApiList(request);
|
||||||
List<String> versionIds = apiTestCaseDTOS.stream().map(ApiTestCaseDTO::getVersionId).collect(Collectors.toList());
|
List<String> versionIds = apiTestCaseDTOS.stream().map(ApiTestCaseDTO::getVersionId).collect(Collectors.toList());
|
||||||
ProjectVersionService projectVersionService = CommonBeanFactory.getBean(ProjectVersionService.class);
|
ProjectVersionService projectVersionService = CommonBeanFactory.getBean(ProjectVersionService.class);
|
||||||
|
if (projectVersionService != null) {
|
||||||
Map<String, String> projectVersionMap = projectVersionService.getProjectVersionByIds(versionIds).stream()
|
Map<String, String> projectVersionMap = projectVersionService.getProjectVersionByIds(versionIds).stream()
|
||||||
.collect(Collectors.toMap(ProjectVersion::getId, ProjectVersion::getName));
|
.collect(Collectors.toMap(ProjectVersion::getId, ProjectVersion::getName));
|
||||||
apiTestCaseDTOS.forEach(apiTestCaseDTO -> {
|
apiTestCaseDTOS.forEach(apiTestCaseDTO -> {
|
||||||
apiTestCaseDTO.setVersionName(projectVersionMap.get(apiTestCaseDTO.getVersionId()));
|
apiTestCaseDTO.setVersionName(projectVersionMap.get(apiTestCaseDTO.getVersionId()));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return apiTestCaseDTOS;
|
return apiTestCaseDTOS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1177,11 +1179,13 @@ public class ApiTestCaseService {
|
||||||
List<ApiScenarioDTO> apiScenarioDTOS = extApiScenarioMapper.relevanceScenarioList(request);
|
List<ApiScenarioDTO> apiScenarioDTOS = extApiScenarioMapper.relevanceScenarioList(request);
|
||||||
List<String> versionIds = apiScenarioDTOS.stream().map(ApiScenarioDTO::getVersionId).collect(Collectors.toList());
|
List<String> versionIds = apiScenarioDTOS.stream().map(ApiScenarioDTO::getVersionId).collect(Collectors.toList());
|
||||||
ProjectVersionService projectVersionService = CommonBeanFactory.getBean(ProjectVersionService.class);
|
ProjectVersionService projectVersionService = CommonBeanFactory.getBean(ProjectVersionService.class);
|
||||||
|
if (projectVersionService != null) {
|
||||||
Map<String, String> projectVersionMap = projectVersionService.getProjectVersionByIds(versionIds).stream()
|
Map<String, String> projectVersionMap = projectVersionService.getProjectVersionByIds(versionIds).stream()
|
||||||
.collect(Collectors.toMap(ProjectVersion::getId, ProjectVersion::getName));
|
.collect(Collectors.toMap(ProjectVersion::getId, ProjectVersion::getName));
|
||||||
apiScenarioDTOS.forEach(apiTestCaseDTO -> {
|
apiScenarioDTOS.forEach(apiTestCaseDTO -> {
|
||||||
apiTestCaseDTO.setVersionName(projectVersionMap.get(apiTestCaseDTO.getVersionId()));
|
apiTestCaseDTO.setVersionName(projectVersionMap.get(apiTestCaseDTO.getVersionId()));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return apiScenarioDTOS;
|
return apiScenarioDTOS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ public class PerformanceTestCaseService {
|
||||||
public void buildVersionInfo(List<LoadTestDTO> loadTests) {
|
public void buildVersionInfo(List<LoadTestDTO> loadTests) {
|
||||||
List<String> versionIds = loadTests.stream().map(LoadTestDTO::getVersionId).collect(Collectors.toList());
|
List<String> versionIds = loadTests.stream().map(LoadTestDTO::getVersionId).collect(Collectors.toList());
|
||||||
ProjectVersionService projectVersionService = CommonBeanFactory.getBean(ProjectVersionService.class);
|
ProjectVersionService projectVersionService = CommonBeanFactory.getBean(ProjectVersionService.class);
|
||||||
|
if(projectVersionService != null) {
|
||||||
Map<String, String> projectVersionMap = projectVersionService.getProjectVersionByIds(versionIds).stream()
|
Map<String, String> projectVersionMap = projectVersionService.getProjectVersionByIds(versionIds).stream()
|
||||||
.collect(Collectors.toMap(ProjectVersion::getId, ProjectVersion::getName));
|
.collect(Collectors.toMap(ProjectVersion::getId, ProjectVersion::getName));
|
||||||
loadTests.forEach(loadTest -> {
|
loadTests.forEach(loadTest -> {
|
||||||
|
@ -38,3 +39,4 @@ public class PerformanceTestCaseService {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue