fix: 删除相关用户,接口测试用例列表报错

This commit is contained in:
chenjianxing 2021-03-11 10:30:40 +08:00
parent 2b9713b143
commit 95db94e83e
1 changed files with 8 additions and 2 deletions

View File

@ -123,8 +123,14 @@ public class ApiTestCaseService {
if (!CollectionUtils.isEmpty(userIds)) {
Map<String, User> userMap = userService.queryNameByIds(userIds);
apiTestCases.forEach(caseResult -> {
caseResult.setCreateUser(userMap.get(caseResult.getCreateUserId()).getName());
caseResult.setUpdateUser(userMap.get(caseResult.getUpdateUserId()).getName());
User createUser = userMap.get(caseResult.getCreateUserId());
if (createUser != null) {
caseResult.setCreateUser(createUser.getName());
}
User updateUser = userMap.get(caseResult.getUpdateUserId());
if (updateUser != null) {
caseResult.setUpdateUser(updateUser.getName());
}
});
}
}