fix(接口测试): 优化接口路径的匹配方法
This commit is contained in:
parent
28d31bf6e7
commit
2a837d6342
|
@ -719,7 +719,7 @@ public class MockApiUtils {
|
|||
if (CollectionUtils.isEmpty(urlList)) {
|
||||
return false;
|
||||
}
|
||||
String urlSuffix = url;
|
||||
String urlSuffix = url.trim();
|
||||
if (urlSuffix.startsWith("/")) {
|
||||
urlSuffix = urlSuffix.substring(1);
|
||||
}
|
||||
|
|
|
@ -2332,10 +2332,10 @@ public class ApiScenarioService {
|
|||
list.forEach(item -> {
|
||||
String method = item.getMethod() == null ? "MS_NOT_HTTP" : item.getMethod();
|
||||
if (returnMap.containsKey(method)) {
|
||||
returnMap.get(method).put(item.getReferenceId(), item.getUrl());
|
||||
returnMap.get(method).put(item.getReferenceId(), StringUtils.trim(item.getUrl()));
|
||||
} else {
|
||||
Map<String, String> urlMap = new HashMap<>() {{
|
||||
this.put(item.getReferenceId(), item.getUrl());
|
||||
this.put(item.getReferenceId(), StringUtils.trim(item.getUrl()));
|
||||
}};
|
||||
returnMap.put(method, urlMap);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue