提交 f529be99 authored 作者: 黄夏豪's avatar 黄夏豪

fix(base): 修了ExecutionController会出现空指针的情况

上级 ac1c4fa2
...@@ -331,6 +331,7 @@ public class CaseActuator implements Actuator { ...@@ -331,6 +331,7 @@ public class CaseActuator implements Actuator {
} }
break; break;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
TestCaseReport testCaseReport = new TestCaseReport( TestCaseReport testCaseReport = new TestCaseReport(
caseStartTime, caseStartTime,
LocalDateTime.now(), LocalDateTime.now(),
......
...@@ -106,7 +106,6 @@ public class ExecutionRecordController { ...@@ -106,7 +106,6 @@ public class ExecutionRecordController {
List<ExecutionRecord> results = getExecutionRecords(userId, testDataId, testCaseId, uniqueKey, type); List<ExecutionRecord> results = getExecutionRecords(userId, testDataId, testCaseId, uniqueKey, type);
Map<Long, Map<Long, Map<Long, List<String>>>> resultMap = new HashMap<>(); Map<Long, Map<Long, Map<Long, List<String>>>> resultMap = new HashMap<>();
return CommonResult.success(results, "查询成功"); return CommonResult.success(results, "查询成功");
} }
/** /**
...@@ -132,7 +131,9 @@ public class ExecutionRecordController { ...@@ -132,7 +131,9 @@ public class ExecutionRecordController {
for (ExecutionRecord result : results) { for (ExecutionRecord result : results) {
ExecutionRecordVo recordVo = new ExecutionRecordVo(); ExecutionRecordVo recordVo = new ExecutionRecordVo();
BeanUtils.copyProperties(result, recordVo); BeanUtils.copyProperties(result, recordVo);
recordVo.setJobName(testJobService.getById(result.getTestJobId()).getName()); if (result.getTestJobId()>0){
recordVo.setJobName(testJobService.getById(result.getTestJobId()).getName());
}
recordVo.setCaseName(testCaseService.getById(result.getTestCaseId()).getName()); recordVo.setCaseName(testCaseService.getById(result.getTestCaseId()).getName());
if (recordVo.getTestDataId() != -1L) { if (recordVo.getTestDataId() != -1L) {
recordVo.setDataName(testDataService.getById(result.getTestDataId()).getName()); recordVo.setDataName(testDataService.getById(result.getTestDataId()).getName());
......
...@@ -127,9 +127,9 @@ public class SwaggerController { ...@@ -127,9 +127,9 @@ public class SwaggerController {
Object summary = objRequestMaps.get("summary"); Object summary = objRequestMaps.get("summary");
List<Parameter> parameterAllList = new ArrayList<>(); List<Parameter> parameterAllList = new ArrayList<>();
InterfaceInformation interfaceInformation = new InterfaceInformation(); InterfaceInformation interfaceInformation = new InterfaceInformation();
if (parameters != null) { if (true) {
@SuppressWarnings(value = "all") @SuppressWarnings(value = "all")
List<String> parameterLists = (List<String>) parameters; List<String> parameterLists = parameters == null ? new ArrayList<>(): (List<String>)parameters;
for (Object parameterList : parameterLists) { for (Object parameterList : parameterLists) {
@SuppressWarnings(value = "unchecked") @SuppressWarnings(value = "unchecked")
Map<String, String> parameterMaps = (Map<String, String>) parameterList; Map<String, String> parameterMaps = (Map<String, String>) parameterList;
......
...@@ -20,8 +20,8 @@ spring: ...@@ -20,8 +20,8 @@ spring:
password: 123456 password: 123456
mybatis-plus: mybatis-plus:
configuration: # configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
type-enums-package: org.matrix.enums type-enums-package: org.matrix.enums
baseJsPath: syntaxCheck.js baseJsPath: syntaxCheck.js
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论