MCPcopy Create free account
hub / github.com/ChenSen5/api_autotest / parseUrl

Method parseUrl

src/test/java/test/com/sen/api/ApiTest.java:249–263  ·  view source on GitHub ↗

格式化url,替换路径参数等。 @param shortUrl @return

(String shortUrl)

Source from the content-addressed store, hash-verified

247 * @return
248 */
249 private String parseUrl(String shortUrl) {
250 // 替换url中的参数
251 shortUrl = getCommonParam(shortUrl);
252 if (shortUrl.startsWith("http")) {
253 return shortUrl;
254 }
255 if (rooUrlEndWithSlash == shortUrl.startsWith("/")) {
256 if (rooUrlEndWithSlash) {
257 shortUrl = shortUrl.replaceFirst("/", "");
258 } else {
259 shortUrl = "/" + shortUrl;
260 }
261 }
262 return rootUrl + shortUrl;
263 }
264
265}
266

Callers 1

parseHttpRequestMethod · 0.95

Calls 2

getCommonParamMethod · 0.80
replaceFirstMethod · 0.80

Tested by

no test coverage detected