fix(接口定义): 修复引用case没有超时时间的缺陷

--bug=1022544 --user=王孝刚
【接口测试】github#21594,swagger、postman、har格式导入的接口没有配置默认超时时间,导致修改case的超时时间后,场景中引用的case也不能同步修改超时时间
https://www.tapd.cn/55049933/s/1341836
This commit is contained in:
wxg0103 2023-02-23 12:08:27 +08:00 committed by wxg0103
parent 0cd40db564
commit 2bc5a96b6f
1 changed files with 11 additions and 0 deletions

View File

@ -65,6 +65,12 @@ public class MsHashTreeService {
public static final String ACTIVE = "active";
public static final String ENV_MAP = "environmentMap";
private static final String CONNECT_TIMEOUT = "connectTimeout";
private static final String RESPONSE_TIMEOUT = "responseTimeout";
private static final String FOLLOW_REDIRECTS = "followRedirects";
private static final String AUTO_REDIRECTS = "autoRedirects";
private static final String ALIAS = "alias";
public void setHashTree(JSONArray hashTree) {
// 将引用转成复制
if (CollectionUtils.isEmpty(hashTree)) {
@ -197,6 +203,11 @@ public class MsHashTreeService {
element.put(AUTH_MANAGER, refElement.get(AUTH_MANAGER));
element.put(ARGUMENTS, refElement.get(ARGUMENTS));
element.put(PROJECT_ID, apiTestCase.getProjectId());
element.put(CONNECT_TIMEOUT, refElement.get(CONNECT_TIMEOUT));
element.put(RESPONSE_TIMEOUT, refElement.get(RESPONSE_TIMEOUT));
element.put(FOLLOW_REDIRECTS, refElement.get(FOLLOW_REDIRECTS));
element.put(AUTO_REDIRECTS, refElement.get(AUTO_REDIRECTS));
element.put(ALIAS, refElement.get(ALIAS));
if (array != null) {
JSONArray sourceHashTree = element.getJSONArray(HASH_TREE);
Map<String, List<JSONObject>> groupMap = ElementUtil.group(sourceHashTree);