是否可以使用JsonPath计算成员数?
使用spring mvc test我正在测试一个生成的控制器
{"foo": "oof", "bar": "rab"}
Run Code Online (Sandbox Code Playgroud)
同
standaloneSetup(new FooController(fooService)).build()
.perform(get("/something").accept(MediaType.APPLICATION_JSON)).andExpect(status().isOk())
.andExpect(jsonPath("$.foo").value("oof"))
.andExpect(jsonPath("$.bar").value("rab"));
Run Code Online (Sandbox Code Playgroud)
我想确保生成的json中没有其他成员.希望通过使用jsonPath计算它们.可能吗?也欢迎替代解决方案.