fix(接口测试): 自定义请求接口覆盖率计算问题
--bug=1026406 --user=宋昌昌 【接口测试】未开启url可重复-场景用例数量统计-接口覆盖率有误 https://www.tapd.cn/55049933/s/1376830
This commit is contained in:
parent
402abd81bc
commit
0614b47c14
|
@ -753,9 +753,20 @@ public class MockApiUtils {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 去除URL中前缀后匹配
|
||||||
|
return isPathMatchWithoutPrefix(path, url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isPathMatchWithoutPrefix(String path, String url) {
|
||||||
|
String pathNoProtocol = path.replaceAll("http[s]?://", "");
|
||||||
|
int firstIndex = pathNoProtocol.indexOf("/");
|
||||||
|
if (firstIndex > 0) {
|
||||||
|
pathNoProtocol = pathNoProtocol.substring(firstIndex);
|
||||||
|
}
|
||||||
|
return StringUtils.equalsAny(pathNoProtocol, url, "/" + url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue