String jsonString = "
{
"success": true,
"total": 282,
"timeTaken": 31,
"responseCode": 200,
"facet_count": {},
"inferred":
{
"city": null,
"locality": null,
"cityList": null,
"state": null
}
}
";
问题:将“locality”值更新为“ABCD”
我知道如何使用 com.jayway,下面是代码
Configuration configuration = Configuration.builder()
.jsonProvider(new JacksonJsonNodeJsonProvider())
.mappingProvider(new JacksonMappingProvider()).build();
DocumentContext json = com.jayway.jsonpath.JsonPath.using(configuration)
.parse(jsonString);
System.out.println(json.set("inferred.locality", "ABCD").jsonString());
但无法使用 io.rest-assured 3.0 版。