(String sourchData, String verifyStr, boolean contains)
| 132 | } |
| 133 | |
| 134 | protected void verifyResult(String sourchData, String verifyStr, |
| 135 | boolean contains) { |
| 136 | if (StringUtil.isEmpty(verifyStr)) { |
| 137 | return; |
| 138 | } |
| 139 | String allVerify = getCommonParam(verifyStr); |
| 140 | ReportUtil.log("验证数据:" + allVerify); |
| 141 | if (contains) { |
| 142 | // 验证结果包含 |
| 143 | AssertUtil.contains(sourchData, allVerify); |
| 144 | } else { |
| 145 | // 通过';'分隔,通过jsonPath进行一一校验 |
| 146 | Pattern pattern = Pattern.compile("([^;]*)=([^;]*)"); |
| 147 | Matcher m = pattern.matcher(allVerify.trim()); |
| 148 | while (m.find()) { |
| 149 | String actualValue = getBuildValue(sourchData, m.group(1)); |
| 150 | String exceptValue = getBuildValue(sourchData, m.group(2)); |
| 151 | ReportUtil.log(String.format("验证转换后的值%s=%s", actualValue, |
| 152 | exceptValue)); |
| 153 | Assert.assertEquals(actualValue, exceptValue, "验证预期结果失败。"); |
| 154 | } |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | /** |
| 159 | * 获取格式化后的值 |
no test coverage detected