fix(接口定义): 修复导入postman文件场景名称为空报错的缺陷

--bug=1018127 --user=王孝刚 【接口测试】接口自动化场景导入postman无模块场景提示500
https://www.tapd.cn/55049933/s/1262717
This commit is contained in:
wxg0103 2022-10-15 22:03:45 +08:00 committed by fit2-zhao
parent 6b6cf1a86a
commit ec7097b6a2
4 changed files with 6 additions and 0 deletions

View File

@ -1376,6 +1376,9 @@ public class ApiScenarioService {
for (int i = 0; i < data.size(); i++) { for (int i = 0; i < data.size(); i++) {
ApiScenarioWithBLOBs item = data.get(i); ApiScenarioWithBLOBs item = data.get(i);
if (StringUtils.isBlank(item.getName())) {
MSException.throwException(Translator.get("scenario_name_is_null"));
}
List<ApiScenarioWithBLOBs> sameList = needUpdateList.stream().filter(t -> t.getId().equals(item.getId())).collect(toList()); List<ApiScenarioWithBLOBs> sameList = needUpdateList.stream().filter(t -> t.getId().equals(item.getId())).collect(toList());
if (StringUtils.isBlank(item.getCreateUser())) { if (StringUtils.isBlank(item.getCreateUser())) {
item.setCreateUser(SessionUtils.getUserId()); item.setCreateUser(SessionUtils.getUserId());

View File

@ -293,6 +293,7 @@ connection_expired=The connection has expired, please get it again
api_case=Api api_case=Api
performance_case=Performance performance_case=Performance
scenario_case=Scenario scenario_case=Scenario
scenario_name_is_null=Scenario name cannot be empty
create_user=Create user create_user=Create user
test_case_status=Case status test_case_status=Case status
id_not_rightful=ID is not rightful id_not_rightful=ID is not rightful

View File

@ -288,6 +288,7 @@ connection_expired=连接已失效,请重新获取
api_case=接口用例 api_case=接口用例
performance_case=性能用例 performance_case=性能用例
scenario_case=场景用例 scenario_case=场景用例
scenario_name_is_null=场景名称不能为空
test_case_status_error=失败 test_case_status_error=失败
test_case_status_success=成功 test_case_status_success=成功
test_case_status_trash=废弃 test_case_status_trash=废弃

View File

@ -287,6 +287,7 @@ connection_expired=連接已失效,請重新獲取
api_case=接口用例 api_case=接口用例
performance_case=性能用例 performance_case=性能用例
scenario_case=場景用例 scenario_case=場景用例
scenario_name_is_null=場景名稱不能為空
test_case_status_error=失敗 test_case_status_error=失敗
test_case_status_success=成功 test_case_status_success=成功
test_case_status_trash=廢棄 test_case_status_trash=廢棄