fix(接口测试): 修复用例集成报告中未执行报告的筛选错误问题

修复用例集成报告中未执行报告的筛选错误问题
This commit is contained in:
song-tianyang 2022-03-23 14:47:19 +08:00 committed by CountryBuilder
parent 3bbe2f428f
commit 2ac3a8e3a4

View File

@ -401,7 +401,9 @@ public class ApiScenarioReportStructureService {
if (expandDTO.getAttachInfoMap() != null && expandDTO.getAttachInfoMap().get("errorReportResult") != null) {
treeDTO.setErrorCode(expandDTO.getAttachInfoMap().get("errorReportResult"));
treeDTO.setTotalStatus("errorCode");
vo.setStatus("errorReportResult");
} else if (StringUtils.isNotEmpty(expandDTO.getStatus())) {
vo.setStatus(expandDTO.getStatus());
treeDTO.setTotalStatus(expandDTO.getStatus());
} else {
if (expandDTO.isSuccess()) {
@ -426,7 +428,7 @@ public class ApiScenarioReportStructureService {
if (CollectionUtils.isNotEmpty(reportResults)) {
reportDTO.setTotal(reportResults.size());
reportDTO.setError(reportResults.stream().filter(e -> StringUtils.equalsAnyIgnoreCase(e.getStatus(), "Error")).collect(Collectors.toList()).size());
reportDTO.setUnExecute(reportResults.stream().filter(e -> StringUtils.equalsAnyIgnoreCase(e.getStatus(), "STOP")).collect(Collectors.toList()).size());
reportDTO.setUnExecute(reportResults.stream().filter(e -> StringUtils.equalsAnyIgnoreCase(e.getStatus(), "STOP","unexecute")).collect(Collectors.toList()).size());
reportDTO.setErrorCode(reportResults.stream().filter(e -> StringUtils.equalsAnyIgnoreCase(e.getStatus(), "errorReportResult")).collect(Collectors.toList()).size());
reportDTO.setPassAssertions(reportResults.stream().mapToLong(ApiDefinitionExecResultVo::getPassAssertions).sum());
reportDTO.setTotalAssertions(reportResults.stream().mapToLong(ApiDefinitionExecResultVo::getTotalAssertions).sum());