我在使用 Spring REST Docs 和阻止请求正文中的字段的深层文档时遇到问题:
@Transactional
@RequestMapping(path = "/edit", method = RequestMethod.POST)
public ResponseEntity<Void> edit(
@RequestParam("id") Long id,
@RequestBody TreeItemResource root)
和文档测试:
@Test
public void edit() throws Exception {
//...
this.getMockMvc(this.controller).perform(post("/edit"))
.andDo(document("root",
requestFields(
subsectionWithPath("childs"))));
}
这个测试需要很多时间,输出如下:
root.childs[].childs[].childs[].childs[].childs[].childs[].path
我怎样才能防止这种情况?