public abstract class ValidatableResponseOptionsImpl<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>> extends Object implements ValidatableResponseLogSpec<T,R>
Modifier and Type | Field and Description |
---|---|
protected Response |
response |
ResponseSpecificationImpl |
responseSpec |
Constructor and Description |
---|
ValidatableResponseOptionsImpl(ResponseParserRegistrar rpr,
RestAssuredConfig config,
Response response,
ExtractableResponse<R> extractableResponse,
LogRepository logRepository) |
Modifier and Type | Method and Description |
---|---|
T |
all()
Logs everything in the response, including e.g.
|
T |
all(boolean shouldPrettyPrint)
Logs everything in the response, including e.g.
|
T |
and() |
T |
appendRootPath(String pathToAppend) |
T |
appendRootPath(String pathToAppend,
List<Argument> arguments) |
T |
assertThat() |
T |
body()
Logs only the content of the body.
|
T |
body(boolean shouldPrettyPrint)
Logs only the content of the body and pretty-print the body if specified.
|
T |
body(List<Argument> arguments,
org.hamcrest.Matcher matcher,
Object... additionalKeyMatcherPairs) |
T |
body(List<Argument> arguments,
ResponseAwareMatcher<R> responseAwareMatcher) |
T |
body(org.hamcrest.Matcher<?> matcher,
org.hamcrest.Matcher<?>... additionalMatchers) |
T |
body(String path,
List<Argument> arguments,
org.hamcrest.Matcher matcher,
Object... additionalKeyMatcherPairs) |
T |
body(String key,
List<Argument> arguments,
ResponseAwareMatcher<R> responseAwareMatcher) |
T |
body(String path,
org.hamcrest.Matcher<?> matcher,
Object... additionalKeyMatcherPairs) |
T |
body(String key,
ResponseAwareMatcher<R> responseAwareMatcher) |
T |
content(String path,
List<Argument> arguments,
org.hamcrest.Matcher matcher,
Object... additionalKeyMatcherPairs) |
T |
contentType(ContentType contentType) |
T |
contentType(org.hamcrest.Matcher<? super String> contentType) |
T |
contentType(String contentType) |
T |
cookie(String cookieName) |
T |
cookie(String cookieName,
DetailedCookieMatcher detailedCookieMatcher) |
T |
cookie(String cookieName,
org.hamcrest.Matcher<?> expectedValueMatcher) |
T |
cookie(String cookieName,
Object expectedValue) |
T |
cookies()
Logs only the cookies.
|
T |
cookies(Map<String,?> expectedCookies) |
T |
cookies(String firstExpectedCookieName,
Object firstExpectedCookieValue,
Object... expectedCookieNameValuePairs) |
T |
defaultParser(Parser parser) |
T |
detachRootPath(String pathToDetach) |
T |
everything()
Logs everything in the response, including e.g.
|
T |
everything(boolean shouldPrettyPrint)
* Logs everything in the response, including e.g.
|
ExtractableResponse<R> |
extract() |
<U> T |
header(String headerName,
java.util.function.Function<String,U> f,
org.hamcrest.Matcher<? super U> matcher) |
T |
header(String headerName,
org.hamcrest.Matcher<?> expectedValueMatcher) |
T |
header(String headerName,
ResponseAwareMatcher<R> r) |
T |
header(String headerName,
String expectedValue) |
T |
headers()
Logs only the headers.
|
T |
headers(Map<String,?> expectedHeaders) |
T |
headers(String firstExpectedHeaderName,
Object firstExpectedHeaderValue,
Object... expectedHeaders) |
T |
ifError()
Logs everything only if an error occurs (status code >= 400).
|
T |
ifStatusCodeIsEqualTo(int statusCode)
Logs everything only if if the status code is equal to
statusCode . |
T |
ifStatusCodeMatches(org.hamcrest.Matcher<Integer> matcher)
Logs everything only if if the status code matches the supplied
matcher |
T |
ifValidationFails()
Logs everything if a test validation fails.
|
T |
ifValidationFails(LogDetail logDetail)
Logs with the supplied log detail only if the validation fails.
|
T |
ifValidationFails(LogDetail logDetail,
boolean shouldPrettyPrint)
Logs all parameters only if the validations fail.
|
ValidatableResponseLogSpec |
log() |
T |
noRoot() |
T |
noRootPath() |
abstract R |
originalResponse() |
T |
parser(String contentType,
Parser parser) |
T |
root(String rootPath) |
T |
root(String rootPath,
List<Argument> arguments) |
T |
rootPath(String rootPath) |
T |
rootPath(String rootPath,
List<Argument> arguments) |
T |
spec(ResponseSpecification responseSpecification) |
T |
status()
Logs only the status line (includes the status code)
|
T |
statusCode(int expectedStatusCode) |
T |
statusCode(org.hamcrest.Matcher<? super Integer> expectedStatusCode) |
T |
statusLine(org.hamcrest.Matcher<? super String> expectedStatusLine) |
T |
statusLine(String expectedStatusLine) |
T |
time(org.hamcrest.Matcher<Long> matcher) |
T |
time(org.hamcrest.Matcher<Long> matcher,
TimeUnit timeUnit) |
T |
using() |
public final ResponseSpecificationImpl responseSpec
protected final Response response
public ValidatableResponseOptionsImpl(ResponseParserRegistrar rpr, RestAssuredConfig config, Response response, ExtractableResponse<R> extractableResponse, LogRepository logRepository)
public T body(List<Argument> arguments, ResponseAwareMatcher<R> responseAwareMatcher)
public T body(String key, List<Argument> arguments, ResponseAwareMatcher<R> responseAwareMatcher)
public T body(String key, ResponseAwareMatcher<R> responseAwareMatcher)
public T body(String path, List<Argument> arguments, org.hamcrest.Matcher matcher, Object... additionalKeyMatcherPairs)
public T body(List<Argument> arguments, org.hamcrest.Matcher matcher, Object... additionalKeyMatcherPairs)
public T statusCode(int expectedStatusCode)
public T headers(String firstExpectedHeaderName, Object firstExpectedHeaderValue, Object... expectedHeaders)
public T header(String headerName, ResponseAwareMatcher<R> r)
public <U> T header(String headerName, java.util.function.Function<String,U> f, org.hamcrest.Matcher<? super U> matcher)
public T cookies(String firstExpectedCookieName, Object firstExpectedCookieValue, Object... expectedCookieNameValuePairs)
public T cookie(String cookieName, DetailedCookieMatcher detailedCookieMatcher)
public T noRoot()
public T noRootPath()
public T contentType(ContentType contentType)
public T body(org.hamcrest.Matcher<?> matcher, org.hamcrest.Matcher<?>... additionalMatchers)
public T body(String path, org.hamcrest.Matcher<?> matcher, Object... additionalKeyMatcherPairs)
public T content(String path, List<Argument> arguments, org.hamcrest.Matcher matcher, Object... additionalKeyMatcherPairs)
public T and()
public T using()
public T assertThat()
public T spec(ResponseSpecification responseSpecification)
public ExtractableResponse<R> extract()
public ValidatableResponseLogSpec log()
public T status()
ValidatableResponseLogSpec
status
in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>
public T ifError()
ValidatableResponseLogSpec
ifError
in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>
public T ifStatusCodeIsEqualTo(int statusCode)
ValidatableResponseLogSpec
statusCode
.ifStatusCodeIsEqualTo
in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>
statusCode
- The status codepublic T ifStatusCodeMatches(org.hamcrest.Matcher<Integer> matcher)
ValidatableResponseLogSpec
matcher
ifStatusCodeMatches
in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>
matcher
- The hamcrest matcherpublic T body()
ValidatableResponseLogSpec
body
in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>
public T body(boolean shouldPrettyPrint)
ValidatableResponseLogSpec
body
in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>
shouldPrettyPrint
- true
if the body should be pretty-printed, false
otherwise.public T all()
ValidatableResponseLogSpec
all
in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>
public T all(boolean shouldPrettyPrint)
ValidatableResponseLogSpec
all
in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>
shouldPrettyPrint
- true
if the body should be pretty-printed, false
otherwise.public T everything()
ValidatableResponseLogSpec
everything
in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>
public T everything(boolean shouldPrettyPrint)
ValidatableResponseLogSpec
everything
in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>
shouldPrettyPrint
- true
if the body should be pretty-printed, false
otherwise.public T headers()
ValidatableResponseLogSpec
headers
in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>
public T cookies()
ValidatableResponseLogSpec
cookies
in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>
public T ifValidationFails()
ValidatableResponseLogSpec
ifValidationFails
in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>
public T ifValidationFails(LogDetail logDetail)
ValidatableResponseLogSpec
ifValidationFails
in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>
logDetail
- The log detailpublic T ifValidationFails(LogDetail logDetail, boolean shouldPrettyPrint)
ValidatableResponseLogSpec
ifValidationFails
in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>
logDetail
- The log detailshouldPrettyPrint
- true
if the body should be pretty-printed, false
otherwise.public abstract R originalResponse()
Copyright © 2010–2019. All rights reserved.