public class ContentResult extends GenericContentResult<String>
content, resultActionsmockResponse| 构造器和说明 |
|---|
ContentResult(MockResponse mockResponse,
org.springframework.test.web.servlet.ResultActions resultActions,
String content) |
| 限定符和类型 | 方法和说明 |
|---|---|
ContentResult |
is(int expectedSize)
如果响应内容为列表数据,则校验数据量
|
ContentResult |
is(String expectedContent)
校验响应内容
|
ContentResult |
is(String jsonPathExpression,
Object expectedValue)
校验表达式对应的值
|
ContentResult |
isMatch(Pattern expectedContentPattern)
根据正则,校验响应内容格式
|
ContentResult |
isMatch(String expectedContentPattern)
根据匹配串,校验响应内容格式
|
isendpublic ContentResult(MockResponse mockResponse, org.springframework.test.web.servlet.ResultActions resultActions, String content)
public ContentResult is(String expectedContent)
expectedContent - 预期响应内容public ContentResult is(String jsonPathExpression, Object expectedValue)
jsonPathExpression - JSON路径表达式expectedValue - 预期值public ContentResult is(int expectedSize)
expectedSize - 预期的列表数据数量public ContentResult isMatch(String expectedContentPattern)
expectedContentPattern - 预期响应内容格式,可以是正则,也可以是简易匹配串public ContentResult isMatch(Pattern expectedContentPattern)
expectedContentPattern - 预期响应内容格式正则Copyright © 2021 EasyJ寮�婧愮ぞ鍖�. All rights reserved.