public class HeaderResult extends BaseResult
mockResponse| Constructor and Description |
|---|
HeaderResult(MockResponse mockResponse,
org.springframework.mock.web.MockHttpServletResponse response) |
| Modifier and Type | Method and Description |
|---|---|
HeaderResult |
contains(String... expectedContainsHeaderNames)
判断响应头是否存在
|
HeaderResult |
is(String headerName,
Object expectedHeaderValue)
判断响应头的值
|
HeaderResult |
isMatch(String headerName,
Pattern expectedHeaderValuePattern)
根据正则判断响应头的值的格式
|
HeaderResult |
isMatch(String headerName,
String expectedHeaderValuePattern)
根据匹配串判断响应头的值的格式
|
HeaderResult |
notContains(String... expectedNotContainsHeaderNames)
判断响应头是否不存在
|
endpublic HeaderResult(MockResponse mockResponse, org.springframework.mock.web.MockHttpServletResponse response)
public HeaderResult is(String headerName, Object expectedHeaderValue)
headerName - 响应头键expectedHeaderValue - 响应头预期值public HeaderResult isMatch(String headerName, String expectedHeaderValuePattern)
headerName - 响应头键expectedHeaderValuePattern - 响应头预期格式串,可以是正则,也可以是简易匹配串public HeaderResult isMatch(String headerName, Pattern expectedHeaderValuePattern)
headerName - 响应头键expectedHeaderValuePattern - 响应头预期格式正则public HeaderResult contains(String... expectedContainsHeaderNames)
expectedContainsHeaderNames - 预期存在的响应头键数组public HeaderResult notContains(String... expectedNotContainsHeaderNames)
expectedNotContainsHeaderNames - 预期不存在的响应头键数组Copyright © 2021–2022 EasyJ开源社区. All rights reserved.