0

I am using cucumber to define my test script and in one of my test steps is below **And response Get Countries and Cities names |Response.Data["countries_and_cities_names "][0].language_code | IT | **

glue code behind is

@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())));
        }
    }
}

Error msg :

JSON path Response.Data["countries_and_cities_names "][0].language_code doesn't match. Expected: iterable containing ["IT"] Actual: IT

Can anyone help me to match the both the string?

James Coyle
  • 9,922
  • 1
  • 40
  • 48

0 Answers0