放心的 jsonpath findAll 没有按预期工作

restassured jsonpath findAll not working as expected

我正在尝试在 java 上实现一个方法,请放心,找到查询 JSON 文件的值。为此,我对库 io.restassured.path.json.JsonPath 中的 JSONPath 使用 findAll 方法以访问所需的值。

出于某种未知原因,它从路径而不是我指定的路径获取所有值

 System.out.println(restApi.getValueFromJson(filePath,"purchases.purchase.insuredItems.travelers.travelerPurchase.findAll{it.title = 'Frau'}"));



[{professionalRisk=Medium, firstName=Sh�ra, lastName=Y�ung, riskActivity=Recreational sports, dateOfBirth=1991-12-12, @id=2, title=Frau, individualTravelPrice={#text=20, @currency=EUR}, @role=INSURED}, {professionalRisk=Medium, firstName=Shashank, lastName=Tripathi, riskActivity=Recreational sports, dateOfBirth=1995-05-23, @id=3, title=Frau, individualTravelPrice={#text=100, @currency=EUR}, @role=INSURED}, {professionalRisk=Medium, firstName=J�hn, lastName=Y�nus, riskActivity=Recreational sports, dateOfBirth=2017-12-12, @id=4, title=Frau, individualTravelPrice={#text=258.15, @currency=EUR}, @role=INSURED}, {professionalRisk=Medium, firstName=S�m�el, lastName=Polo, riskActivity=Recreational sports, dateOfBirth=1940-05-10, @id=5, title=Frau, individualTravelPrice={#text=10072, @currency=EUR}, @role=INSURED}, {professionalRisk=Medium, firstName=Gli �ernch, lastName=Fedrick, riskActivity=Recreational sports, dateOfBirth=1930-12-12, @id=6, title=Frau, individualTravelPrice={#text=1000, @currency=EUR}, @role=INSURED}]

而不是

[{professionalRisk=Medium, firstName=Sh�ra, lastName=Y�ung, riskActivity=Recreational sports, dateOfBirth=1991-12-12, @id=2, title=Frau, individualTravelPrice={#text=20, @currency=EUR}, @role=INSURED}]

显然,如果我这样做

System.out.println(restApi.getValueFromJson(filePath,"purchases.purchase.insuredItems.travelers.travelerPurchase.findAll{it.title = 'Frau'}.dateOfBirth"));

需要

[1991-12-12, 1995-05-23, 2017-12-12, 1940-05-10, 1930-12-12]

而不是

[1991-12-12]

我做错了什么?

找到问题了。

我比较的是“=”而不是“==”