【发布时间】:2019-10-13 03:35:28
【问题描述】:
在春天,我为给定的 url 找到了我的 MockMVC:
MvcResult result = this.mockMvc.perform( get(urlToFetch).sessionAttrs(sessionAttr))
.andExpect(status().isOk())
.andReturn();
太好了。现在我想看看这将返回的 html 是什么。我怎么做?我想要它的字符串表示形式(即 String theHtml = ...),以便我可以解析它并在我的测试中检查它。
【问题讨论】: