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

Method getCommonParam

src/test/java/test/com/sen/api/TestBase.java:101–117  ·  view source on GitHub ↗

取公共参数 并替换参数 @param param @return

(String param)

Source from the content-addressed store, hash-verified

99 * @return
100 */
101 protected String getCommonParam(String param) {
102 if (StringUtil.isEmpty(param)) {
103 return "";
104 }
105 Matcher m = replaceParamPattern.matcher(param);// 取公共参数正则
106 while (m.find()) {
107 String replaceKey = m.group(1);
108 String value;
109 // 从公共参数池中获取值
110 value = getSaveData(replaceKey);
111 // 如果公共参数池中未能找到对应的值,该用例失败。
112 Assert.assertNotNull(value,
113 String.format("格式化参数失败,公共参数中找不到%s。", replaceKey));
114 param = param.replace(m.group(), value);
115 }
116 return param;
117 }
118
119 /**
120 * 获取公共数据池中的数据

Callers 4

buildParamMethod · 0.95
verifyResultMethod · 0.95
saveResultMethod · 0.95
parseUrlMethod · 0.80

Calls 2

isEmptyMethod · 0.95
getSaveDataMethod · 0.95

Tested by

no test coverage detected