public class ContentResultMatchers extends Object
HttpResultMatchers.content().| 构造器和说明 |
|---|
ContentResultMatchers() |
| 限定符和类型 | 方法和说明 |
|---|---|
ResultMatcher |
contentType(String contentType)
Assert the Http Response content type.
|
ResultMatcher |
header(String headerName,
org.hamcrest.Matcher<? super String> matcher)
Assert the first response header for the
headerName. |
ResultMatcher |
headers(String headerName,
org.hamcrest.Matcher<? super List<String>> matcher)
Assert all the response headers for the
headerName. |
ResultMatcher |
string(org.hamcrest.Matcher<? super String> matcher)
Assert the response body content with a Hamcrest
Matcher. |
ResultMatcher |
string(String content)
Assert the response body content as a String.
|
public ResultMatcher contentType(String contentType)
public ResultMatcher string(org.hamcrest.Matcher<? super String> matcher)
Matcher.
.andExpect(content(containsString("text")));
public ResultMatcher string(String content)
public ResultMatcher headers(String headerName, org.hamcrest.Matcher<? super List<String>> matcher)
headerName.public ResultMatcher header(String headerName, org.hamcrest.Matcher<? super String> matcher)
headerName.Copyright © 2016. All rights reserved.