refactor (接口测试): 优化场景步骤初始化方法
This commit is contained in:
parent
36a1bfe8b9
commit
64b6b6a9ca
|
@ -1174,7 +1174,7 @@ public class ApiDefinitionService {
|
||||||
.build();
|
.build();
|
||||||
noticeSendService.send(NoticeConstants.Mode.SCHEDULE, "", noticeModel);
|
noticeSendService.send(NoticeConstants.Mode.SCHEDULE, "", noticeModel);
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
} catch (Exception e) {
|
||||||
LogUtil.error(e);
|
LogUtil.error(e);
|
||||||
MSException.throwException(Translator.get("user_import_format_wrong"));
|
MSException.throwException(Translator.get("user_import_format_wrong"));
|
||||||
}
|
}
|
||||||
|
@ -1809,13 +1809,14 @@ public class ApiDefinitionService {
|
||||||
public ApiDefinitionResult getById(String id) {
|
public ApiDefinitionResult getById(String id) {
|
||||||
ApiDefinitionRequest request = new ApiDefinitionRequest();
|
ApiDefinitionRequest request = new ApiDefinitionRequest();
|
||||||
request.setId(id);
|
request.setId(id);
|
||||||
List<ApiDefinitionResult> list = list(request);
|
List<ApiDefinitionResult> list = extApiDefinitionMapper.list(request);
|
||||||
if (CollectionUtils.isNotEmpty(list)) {
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
return list.get(0);
|
return list.get(0);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public long countEffectiveByProjectId(String projectId) {
|
public long countEffectiveByProjectId(String projectId) {
|
||||||
if (StringUtils.isEmpty(projectId)) {
|
if (StringUtils.isEmpty(projectId)) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -201,6 +201,7 @@ public class MsHashTreeService {
|
||||||
this.setElement(element, apiTestCase.getNum(), enable, apiTestCase.getVersionName(), apiTestCase.getVersionEnable());
|
this.setElement(element, apiTestCase.getNum(), enable, apiTestCase.getVersionName(), apiTestCase.getVersionEnable());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (StringUtils.equalsIgnoreCase(element.getString(REFERENCED), "Copy")) {
|
||||||
ApiDefinitionResult definitionWithBLOBs = apiDefinitionService.getById(element.getString(ID));
|
ApiDefinitionResult definitionWithBLOBs = apiDefinitionService.getById(element.getString(ID));
|
||||||
if (definitionWithBLOBs != null) {
|
if (definitionWithBLOBs != null) {
|
||||||
element.put(ID, definitionWithBLOBs.getId());
|
element.put(ID, definitionWithBLOBs.getId());
|
||||||
|
@ -208,6 +209,7 @@ public class MsHashTreeService {
|
||||||
isExist = true;
|
isExist = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!isExist) {
|
if (!isExist) {
|
||||||
if (StringUtils.equalsIgnoreCase(element.getString(REFERENCED), REF)) {
|
if (StringUtils.equalsIgnoreCase(element.getString(REFERENCED), REF)) {
|
||||||
element.put(ENABLE, false);
|
element.put(ENABLE, false);
|
||||||
|
|
Loading…
Reference in New Issue