JsonPath JUnit escape character for dots

后端 未结 3 1090
情书的邮戳
情书的邮戳 2020-12-05 14:54

I have a json field which is called template.welcome.email and I am writing a unit test that checks if that field is present in the reply from the server but I can\'t find a

3条回答
  •  佛祖请我去吃肉
    2020-12-05 15:15

    These days (e.g. io.rest-assured.json-path:3.0.1) the notation seems to be without brackets:

    // Some Groovy OData V4 $count test
    // Response looks like:
    // { "@odata.count": 2, ... }
    body "'@odata.count'", equalTo(2)
    

    I found the corresponding hint in this Git issue.

提交回复
热议问题