断言时出错预期:包含[“ IT”]的可迭代实际:IT

时间:2019-03-25 14:31:24

标签: rest rest-assured rest-assured-jsonpath

我正在使用黄瓜来定义我的测试脚本,下面是我的测试步骤之一 **并回复获取国家和城市名称 | Response.Data [“ countries_and_cities_names”] [0] .language_code | IT | **

后面的胶水代码是

@And("response Get Countries and Cities names")
public void response_Get_Countries_and_Cities_names(Map < String, String > responseFields)
{
    for (Map.Entry < String, String > field : responseFields.entrySet()) {
        if (StringUtils.isNumeric(field.getValue())) {
            json.body(field.getKey(),
                containsInAnyOrder(Integer.parseInt(field.getValue())));
        }
        else {
            json.body(field.getKey(), containsInAnyOrder(String.valueOf(field.getValue())));
        }
    }
}

错误消息:

JSON路径Response.Data [“ countries_and_cities_names”] [0] .language_code不匹配。预期:包含[“ IT”]的可迭代                实际:IT

有人可以帮我匹配两个字符串吗?

0 个答案:

没有答案