如何获取特定键在json中存在的时间,并使用rest assured获取所有这些值

如何获取特定键在json中存在的时间,并使用rest assured获取所有这些值,rest,rest-assured,Rest,Rest Assured,尝试使用rest-assured获取以下json响应中出现键“orgId”的总次数 当我直接使用response.path(“orgId”);返回空值 json响应如下所述。解决这个问题的办法是什么 { "code": 200, "message": "Successfull", "access_token": "2342", "data": [ { "orgId": 131, "orgName": "Publish", "orgUrl

尝试使用rest-assured获取以下json响应中出现键“orgId”的总次数

当我直接使用
response.path(“orgId”);返回空值

json响应如下所述。解决这个问题的办法是什么

{
  "code": 200,
  "message": "Successfull",
  "access_token": "2342",
  "data": [
    {
      "orgId": 131,
      "orgName": "Publish",
      "orgUrl": "http://globalthoughtz.com/",
      "orgDesc": "The much-loved premium Moto X series is now called Moto Z, and has a whole new identity based around snap-on accessories. ",
      "orgLogo": "http://miriadna.com/desctopwalls/images/max/Red-autumn-morning.jpg",
      "assignWhen": null,
      "shareUrl": null,
      "shareTitle": "Share title updated",
      "shareDesc": "A few things have changed in terms of branding and segmentation, which shows that sticking to your roots doesn't mean stagnating. hello",
      "shareImage": "https://s-media-cache-ak0.pinimg.com/236x/fb/5d/91/fb5d91d632ff34e4ae04393926f92bde.jpg",
      "checkTwtStatus": true
    },
    {
      "orgId": 573,
      "orgName": "Marketing",
      "orgUrl": "http://123.com/ ",
      "orgDesc": "werf",
      "orgLogo": "",
      "assignWhen": null,
      "shareUrl": null,
      "shareTitle": null,
      "shareDesc": null,
      "shareImage": null,
      "checkTwtStatus": null
    },
    {
      "orgId": 574,
      "orgName": "Customer Support",
      "orgUrl": "1.com",
      "orgDesc": "test team",
      "orgLogo": "",
      "assignWhen": null,
      "shareUrl": null,
      "shareTitle": "",
      "shareDesc": "",
      "shareImage": "",
      "checkTwtStatus": null
    },
    {
      "orgId": 575,
      "orgName": "Insurance",
      "orgUrl": "facebook.com",
      "orgDesc": "Added From IE",
      "orgLogo": "",
      "assignWhen": null,
      "shareUrl": null,
      "shareTitle": "",
      "shareDesc": "",
      "shareImage": "",
      "checkTwtStatus": null
    },
    {
      "orgId": 637,
      "orgName": "Sales",
      "orgUrl": "http://uae.souq.com/ae-en/apple/smart-watches-511/",
      "orgDesc": "CHECK CSRF ",
      "orgLogo": "http://leads.plus/wp-content/uploads/2016/03/sales-teamwork.jpg",
      "assignWhen": null,
      "shareUrl": null,
      "shareTitle": "",
      "shareDesc": "",
      "shareImage": "",
      "checkTwtStatus": null
    }
  ]
}
path(String,String…),因此,您可以轻松地编写
response.path(“data.orgId.size”)
并获得
data.orgId
数组的实际大小