我怎样才能确保我的响应(包括它是JSON)包含或不包含特定字段?
when()
.get("/person/12345")
.then()
.body("surname", isPresent()) // Doesn't work...
.body("age", isNotPresent()); // ...But that's the idea.
Run Code Online (Sandbox Code Playgroud)
我正在寻找一种方法来断言我的JSON是否包含字段age和surname.