public abstract class ValidatableResponseOptionsImpl<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>> extends Object implements ValidatableResponseLogSpec<T,R>
| Constructor and Description |
|---|
ValidatableResponseOptionsImpl(String contentType,
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 |
appendRoot(String pathToAppend) |
T |
appendRoot(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(List<Argument> arguments,
org.hamcrest.Matcher matcher,
Object... additionalKeyMatcherPairs) |
T |
content(List<Argument> arguments,
ResponseAwareMatcher<R> responseAwareMatcher) |
T |
content(org.hamcrest.Matcher<?> matcher,
org.hamcrest.Matcher<?>... additionalMatchers) |
T |
content(String path,
List<Argument> arguments,
org.hamcrest.Matcher matcher,
Object... additionalKeyMatcherPairs) |
T |
content(String path,
List<Argument> arguments,
ResponseAwareMatcher<R> responseAwareMatcher) |
T |
content(String key,
org.hamcrest.Matcher<?> matcher,
Object... additionalKeyMatcherPairs) |
T |
content(String path,
ResponseAwareMatcher<R> responseAwareMatcher) |
T |
contentType(ContentType contentType) |
T |
contentType(org.hamcrest.Matcher<? super String> contentType) |
T |
contentType(String contentType) |
T |
cookie(String cookieName) |
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 |
detachRoot(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() |
T |
header(String headerName,
org.hamcrest.Matcher<?> expectedValueMatcher) |
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 |
specification(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 |
using() |
protected final Response response
public ValidatableResponseOptionsImpl(String contentType, ResponseParserRegistrar rpr, RestAssuredConfig config, Response response, ExtractableResponse<R> extractableResponse, LogRepository logRepository)
public T content(List<Argument> arguments, ResponseAwareMatcher<R> responseAwareMatcher)
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 content(String path, List<Argument> arguments, ResponseAwareMatcher<R> responseAwareMatcher)
public T content(String path, ResponseAwareMatcher<R> responseAwareMatcher)
public T content(org.hamcrest.Matcher<?> matcher, org.hamcrest.Matcher<?>... additionalMatchers)
public T content(List<Argument> arguments, org.hamcrest.Matcher matcher, Object... additionalKeyMatcherPairs)
public T content(String key, org.hamcrest.Matcher<?> matcher, Object... additionalKeyMatcherPairs)
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 cookies(String firstExpectedCookieName, Object firstExpectedCookieValue, Object... expectedCookieNameValuePairs)
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 T specification(ResponseSpecification responseSpecification)
public ExtractableResponse<R> extract()
public ValidatableResponseLogSpec log()
public T status()
ValidatableResponseLogSpecstatus in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>public T ifError()
ValidatableResponseLogSpecifError in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>public T ifStatusCodeIsEqualTo(int statusCode)
ValidatableResponseLogSpecstatusCode.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)
ValidatableResponseLogSpecmatcherifStatusCodeMatches in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>matcher - The hamcrest matcherpublic T body()
ValidatableResponseLogSpecbody in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>public T body(boolean shouldPrettyPrint)
ValidatableResponseLogSpecbody 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()
ValidatableResponseLogSpecall in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>public T all(boolean shouldPrettyPrint)
ValidatableResponseLogSpecall 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()
ValidatableResponseLogSpeceverything in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>public T everything(boolean shouldPrettyPrint)
ValidatableResponseLogSpeceverything 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()
ValidatableResponseLogSpecheaders in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>public T cookies()
ValidatableResponseLogSpeccookies in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>public T ifValidationFails()
ValidatableResponseLogSpecifValidationFails in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>public T ifValidationFails(LogDetail logDetail)
ValidatableResponseLogSpecifValidationFails in interface ValidatableResponseLogSpec<T extends ValidatableResponseOptions<T,R>,R extends ResponseBody<R> & ResponseOptions<R>>logDetail - The log detailpublic T ifValidationFails(LogDetail logDetail, boolean shouldPrettyPrint)
ValidatableResponseLogSpecifValidationFails 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–2014. All rights reserved.