Package | Description |
---|---|
io.restassured | |
io.restassured.builder | |
io.restassured.internal | |
io.restassured.listener | |
io.restassured.response | |
io.restassured.specification |
Modifier and Type | Field and Description |
---|---|
static ResponseSpecification |
RestAssured.responseSpecification
Specify a default response specification that will be sent with each request.
|
Modifier and Type | Method and Description |
---|---|
static ResponseSpecification |
RestAssured.expect()
Start building the response part of the test io.restassured.specification.
|
Modifier and Type | Method and Description |
---|---|
static RequestSender |
RestAssured.given(RequestSpecification requestSpecification,
ResponseSpecification responseSpecification)
When you have long specifications it can be better to split up the definition of response and request specifications in multiple lines.
|
Modifier and Type | Method and Description |
---|---|
ResponseSpecification |
ResponseSpecBuilder.build()
Build the response specification.
|
Modifier and Type | Method and Description |
---|---|
ResponseSpecBuilder |
ResponseSpecBuilder.addResponseSpecification(ResponseSpecification specification)
Merge this builder with settings from another specification.
|
Modifier and Type | Class and Description |
---|---|
class |
ResponseSpecificationImpl |
Modifier and Type | Method and Description |
---|---|
ResponseSpecification |
ResponseLogSpecificationImpl.all() |
ResponseSpecification |
ResponseLogSpecificationImpl.all(boolean shouldPrettyPrint) |
ResponseSpecification |
ResponseSpecificationImpl.and() |
ResponseSpecification |
ResponseSpecificationImpl.appendRootPath(String pathToAppend) |
ResponseSpecification |
ResponseSpecificationImpl.appendRootPath(String pathToAppend,
List<Argument> arguments) |
ResponseSpecification |
ResponseLogSpecificationImpl.body() |
ResponseSpecification |
ResponseLogSpecificationImpl.body(boolean shouldPrettyPrint) |
ResponseSpecification |
ResponseSpecificationImpl.body(List<Argument> arguments,
org.hamcrest.Matcher matcher,
Object... additionalKeyMatcherPairs) |
ResponseSpecification |
ResponseSpecificationImpl.body(org.hamcrest.Matcher matcher,
org.hamcrest.Matcher... additionalMatchers) |
ResponseSpecification |
ResponseSpecificationImpl.body(String key,
List<Argument> arguments,
org.hamcrest.Matcher matcher,
Object... additionalKeyMatcherPairs) |
ResponseSpecification |
ResponseSpecificationImpl.body(String key,
org.hamcrest.Matcher matcher,
Object... additionalKeyMatcherPairs) |
ResponseSpecification |
ResponseSpecificationImpl.contentType(ContentType contentType) |
ResponseSpecification |
ResponseSpecificationImpl.contentType(org.hamcrest.Matcher<? super String> contentType) |
ResponseSpecification |
ResponseSpecificationImpl.contentType(String contentType) |
ResponseSpecification |
ResponseSpecificationImpl.cookie(String cookieName) |
ResponseSpecification |
ResponseSpecificationImpl.cookie(String cookieName,
DetailedCookieMatcher detailedCookieMatcher) |
ResponseSpecification |
ResponseSpecificationImpl.cookie(String cookieName,
org.hamcrest.Matcher expectedValueMatcher) |
ResponseSpecification |
ResponseSpecificationImpl.cookie(String cookieName,
Object expectedValue) |
ResponseSpecification |
ResponseLogSpecificationImpl.cookies() |
ResponseSpecification |
ResponseSpecificationImpl.cookies(Map expectedCookies) |
ResponseSpecification |
ResponseSpecificationImpl.cookies(String firstExpectedCookieName,
Object firstExpectedCookieValue,
Object... expectedCookieNameValuePairs) |
ResponseSpecification |
ResponseSpecificationImpl.defaultParser(Parser parser) |
ResponseSpecification |
ResponseSpecificationImpl.detachRootPath(String pathToDetach) |
ResponseSpecification |
ResponseLogSpecificationImpl.everything() |
ResponseSpecification |
ResponseLogSpecificationImpl.everything(boolean shouldPrettyPrint) |
ResponseSpecification |
RequestSpecificationImpl.expect() |
ResponseSpecification |
ResponseSpecificationImpl.expect() |
ResponseSpecification |
TestSpecificationImpl.getResponseSpecification() |
ResponseSpecification |
ResponseSpecificationImpl.header(String headerName,
java.util.function.Function mappingFunction,
org.hamcrest.Matcher expectedValueMatcher) |
ResponseSpecification |
ResponseSpecificationImpl.header(String headerName,
org.hamcrest.Matcher expectedValueMatcher) |
ResponseSpecification |
ResponseSpecificationImpl.header(String headerName,
String expectedValue) |
ResponseSpecification |
ResponseLogSpecificationImpl.headers() |
ResponseSpecification |
ResponseSpecificationImpl.headers(Map expectedHeaders) |
ResponseSpecification |
ResponseSpecificationImpl.headers(String firstExpectedHeaderName,
Object firstExpectedHeaderValue,
Object... expectedHeaders) |
ResponseSpecification |
ResponseLogSpecificationImpl.ifError() |
ResponseSpecification |
ResponseLogSpecificationImpl.ifStatusCodeIsEqualTo(int statusCode) |
ResponseSpecification |
ResponseLogSpecificationImpl.ifStatusCodeMatches(org.hamcrest.Matcher<Integer> matcher) |
ResponseSpecification |
ResponseLogSpecificationImpl.ifValidationFails() |
ResponseSpecification |
ResponseLogSpecificationImpl.ifValidationFails(LogDetail logDetail) |
ResponseSpecification |
ResponseLogSpecificationImpl.ifValidationFails(LogDetail logDetail,
boolean shouldPrettyPrint) |
ResponseSpecification |
ResponseSpecificationImpl.noRootPath() |
ResponseSpecification |
ResponseSpecificationImpl.onFailMessage(String message) |
ResponseSpecification |
ResponseSpecificationImpl.parser(String contentType,
Parser parser) |
ResponseSpecification |
RequestSpecificationImpl.response() |
ResponseSpecification |
ResponseSpecificationImpl.response() |
ResponseSpecification |
ResponseSpecificationImpl.root(String rootPath,
List<Argument> arguments) |
ResponseSpecification |
ResponseSpecificationImpl.rootPath(String rootPath) |
ResponseSpecification |
ResponseSpecificationImpl.rootPath(String rootPath,
List<Argument> arguments) |
ResponseSpecification |
ResponseSpecificationImpl.spec(ResponseSpecification responseSpecificationToMerge) |
ResponseSpecification |
ResponseSpecificationImpl.specification(ResponseSpecification responseSpecificationToMerge) |
ResponseSpecification |
ResponseLogSpecificationImpl.status() |
ResponseSpecification |
ResponseSpecificationImpl.statusCode(int expectedStatusCode) |
ResponseSpecification |
ResponseSpecificationImpl.statusCode(org.hamcrest.Matcher<? super Integer> expectedStatusCode) |
ResponseSpecification |
ResponseSpecificationImpl.statusLine(org.hamcrest.Matcher<? super String> expectedStatusLine) |
ResponseSpecification |
ResponseSpecificationImpl.statusLine(String expectedStatusLine) |
ResponseSpecification |
ResponseSpecificationImpl.that() |
ResponseSpecification |
RequestSpecificationImpl.then() |
ResponseSpecification |
ResponseSpecificationImpl.then() |
ResponseSpecification |
ResponseSpecificationImpl.time(org.hamcrest.Matcher<Long> matcher) |
ResponseSpecification |
ResponseSpecificationImpl.time(org.hamcrest.Matcher<Long> matcher,
TimeUnit timeUnit) |
Modifier and Type | Method and Description |
---|---|
void |
LogRequestAndResponseOnFailListener.onFailure(RequestSpecification requestSpecification,
ResponseSpecification responseSpecification,
Response response) |
void |
RequestSpecificationImpl.setResponseSpecification(ResponseSpecification responseSpecification) |
T |
ValidatableResponseOptionsImpl.spec(ResponseSpecification responseSpecification) |
ResponseSpecification |
ResponseSpecificationImpl.spec(ResponseSpecification responseSpecificationToMerge) |
ResponseSpecification |
ResponseSpecificationImpl.specification(ResponseSpecification responseSpecificationToMerge) |
Constructor and Description |
---|
HamcrestAssertionClosure(ResponseSpecification responseSpecification) |
ResponseSpecificationImpl(String bodyRootPath,
ResponseSpecification defaultSpec,
ResponseParserRegistrar rpr,
RestAssuredConfig config,
LogRepository logRepository) |
ResponseSpecificationImpl(String bodyRootPath,
ResponseSpecification defaultSpec,
ResponseParserRegistrar rpr,
RestAssuredConfig config,
Response response,
LogRepository logRepository) |
TestSpecificationImpl(RequestSpecification requestSpecification,
ResponseSpecification responseSpecification) |
Modifier and Type | Method and Description |
---|---|
void |
ResponseValidationFailureListener.onFailure(RequestSpecification requestSpecification,
ResponseSpecification responseSpecification,
Response response)
Called when a failure occurs
|
Modifier and Type | Method and Description |
---|---|
T |
ValidatableResponseOptions.spec(ResponseSpecification responseSpecificationToMerge)
Validate that the response matches an entire specification.
|
Modifier and Type | Interface and Description |
---|---|
interface |
FilterableResponseSpecification
A response specification that also supports getting the defined values.
|
Modifier and Type | Method and Description |
---|---|
ResponseSpecification |
ResponseSpecification.and()
Syntactic sugar, e.g.
|
default ResponseSpecification |
ResponseSpecification.appendRoot(String pathToAppend)
Deprecated.
Use
appendRootPath(String) instead |
default ResponseSpecification |
ResponseSpecification.appendRoot(String pathToAppend,
List<Argument> arguments)
Deprecated.
Use
appendRootPath(String, List) instead |
ResponseSpecification |
ResponseSpecification.appendRootPath(String pathToAppend)
Append the given path to the root path of the response body so that you don't need to write the entire path for each expectation.
|
ResponseSpecification |
ResponseSpecification.appendRootPath(String pathToAppend,
List<Argument> arguments)
Append the given path to the root path with arguments supplied of the response body so that you don't need to write the entire path for each expectation.
|
ResponseSpecification |
ResponseSpecification.body(List<Argument> arguments,
org.hamcrest.Matcher matcher,
Object... additionalKeyMatcherPairs)
This as special kind of expectation that is mainly useful when you've specified a root path with an argument placeholder.
|
ResponseSpecification |
ResponseSpecification.body(org.hamcrest.Matcher<?> matcher,
org.hamcrest.Matcher<?>... additionalMatchers)
Expect that the response body conforms to one or more Hamcrest matchers.
|
ResponseSpecification |
ResponseSpecification.body(String key,
List<Argument> arguments,
org.hamcrest.Matcher matcher,
Object... additionalKeyMatcherPairs)
Same as
body(String, org.hamcrest.Matcher, Object...) expect that you can pass arguments to the key. |
ResponseSpecification |
ResponseSpecification.body(String path,
org.hamcrest.Matcher<?> matcher,
Object... additionalKeyMatcherPairs)
Expect that the JSON or XML response body conforms to one or more Hamcrest matchers.
|
ResponseSpecification |
ResponseSpecification.contentType(ContentType contentType)
Set the response content type to be
contentType . |
ResponseSpecification |
ResponseSpecification.contentType(org.hamcrest.Matcher<? super String> contentType)
Expect the response content type to be
contentType . |
ResponseSpecification |
ResponseSpecification.contentType(String contentType)
Set the response content type to be
contentType . |
ResponseSpecification |
ResponseSpecification.cookie(String cookieName)
Expect that a cookie exist in the response, regardless of value (it may have no value at all).
|
ResponseSpecification |
ResponseSpecification.cookie(String cookieName,
DetailedCookieMatcher detailedCookieMatcher)
Validate that a detailed response cookie matches the supplied cookie name and hamcrest matcher (see
DetailedCookieMatcher . |
ResponseSpecification |
ResponseSpecification.cookie(String cookieName,
org.hamcrest.Matcher<?> expectedValueMatcher)
Expect that a response cookie matches the supplied cookie name and hamcrest matcher.
|
ResponseSpecification |
ResponseSpecification.cookie(String cookieName,
Object expectedValue)
Expect that a response cookie matches the supplied name and value.
|
ResponseSpecification |
ResponseSpecification.cookies(Map<String,?> expectedCookies)
Expect that response cookies matches those specified in a Map.
|
ResponseSpecification |
ResponseSpecification.cookies(String firstExpectedCookieName,
Object firstExpectedCookieValue,
Object... expectedCookieNameValuePairs)
Expect that response cookies matches the supplied cookie names and values.
|
ResponseSpecification |
ResponseSpecification.defaultParser(Parser parser)
Register a default predefined parser that will be used if no other parser (registered or pre-defined) matches the response
content-type.
|
default ResponseSpecification |
ResponseSpecification.detachRoot(String pathToDetach)
Deprecated.
Use
detachRootPath(String) instead |
ResponseSpecification |
ResponseSpecification.detachRootPath(String pathToDetach)
Detach the given path from the root path.
|
ResponseSpecification |
RequestSpecification.expect()
Returns the response specification so that you can setup the expectations on the response.
|
ResponseSpecification |
ResponseSpecification.expect()
Syntactic sugar, e.g.
|
<T> ResponseSpecification |
ResponseSpecification.header(String headerName,
java.util.function.Function<String,T> mappingFunction,
org.hamcrest.Matcher<? super T> expectedValueMatcher)
Expect that a response header matches the supplied header name and hamcrest matcher using a mapping function.
|
ResponseSpecification |
ResponseSpecification.header(String headerName,
org.hamcrest.Matcher<?> expectedValueMatcher)
Expect that a response header matches the supplied header name and hamcrest matcher.
|
ResponseSpecification |
ResponseSpecification.header(String headerName,
String expectedValue)
Expect that a response header matches the supplied name and value.
|
ResponseSpecification |
ResponseSpecification.headers(Map<String,?> expectedHeaders)
Expect that response headers matches those specified in a Map.
|
ResponseSpecification |
ResponseSpecification.headers(String firstExpectedHeaderName,
Object firstExpectedHeaderValue,
Object... expectedHeaders)
Expect that response headers matches the supplied headers and values.
|
ResponseSpecification |
ResponseLogSpecification.ifError()
Logs everything only if an error occurs (status code >= 400).
|
ResponseSpecification |
ResponseLogSpecification.ifStatusCodeIsEqualTo(int statusCode)
Logs everything only if if the status code is equal to
statusCode . |
ResponseSpecification |
ResponseLogSpecification.ifStatusCodeMatches(org.hamcrest.Matcher<Integer> matcher)
Logs everything only if if the status code matches the supplied
matcher |
ResponseSpecification |
ResponseSpecification.logDetail(LogDetail logDetail)
Log different parts of the
ResponseSpecification by using LogDetail . |
default ResponseSpecification |
ResponseSpecification.noRoot()
Deprecated.
Use
noRootPath() instead |
ResponseSpecification |
ResponseSpecification.noRootPath()
Reset the root path of the response body so that you don't need to write the entire path for each expectation.
|
ResponseSpecification |
ResponseSpecification.onFailMessage(String message)
Add user message to final mismatch description.
|
ResponseSpecification |
ResponseSpecification.parser(String contentType,
Parser parser)
Register a content-type to be parsed using a predefined parser.
|
ResponseSpecification |
RequestSpecification.response()
Returns the response specification so that you can setup the expectations on the response.
|
ResponseSpecification |
ResponseSpecification.response()
Syntactic sugar, e.g.
|
default ResponseSpecification |
ResponseSpecification.root(String rootPath)
Deprecated.
Use
rootPath(String) (String)} instead |
default ResponseSpecification |
ResponseSpecification.root(String rootPath,
List<Argument> arguments)
Deprecated.
Use
rootPath(String, List) (String)} instead |
ResponseSpecification |
ResponseSpecification.rootPath(String rootPath)
Set the root path of the response body so that you don't need to write the entire path for each expectation.
|
ResponseSpecification |
ResponseSpecification.rootPath(String rootPath,
List<Argument> arguments)
Set the root path with arguments of the response body so that you don't need to write the entire path for each expectation.
|
ResponseSpecification |
ResponseSpecification.spec(ResponseSpecification responseSpecificationToMerge)
Expect that the response matches an entire specification.
|
ResponseSpecification |
ResponseLogSpecification.status()
Logs only the status line (includes the status code)
|
ResponseSpecification |
ResponseSpecification.statusCode(int expectedStatusCode)
Expect that the response status code matches an integer.
|
ResponseSpecification |
ResponseSpecification.statusCode(org.hamcrest.Matcher<? super Integer> expectedStatusCode)
Expect that the response status code matches the given Hamcrest matcher.
|
ResponseSpecification |
ResponseSpecification.statusLine(org.hamcrest.Matcher<? super String> expectedStatusLine)
Expect that the response status line matches the given Hamcrest matcher.
|
ResponseSpecification |
ResponseSpecification.statusLine(String expectedStatusLine)
Expect that the response status line matches the given String.
|
ResponseSpecification |
ResponseSpecification.that()
Syntactic sugar, e.g.
|
ResponseSpecification |
RequestSpecification.then()
Returns the response specification so that you can setup the expectations on the response.
|
ResponseSpecification |
ResponseSpecification.then()
Syntactic sugar, e.g.
|
ResponseSpecification |
ResponseSpecification.time(org.hamcrest.Matcher<Long> matcher)
Validate that the response time (in milliseconds) matches the supplied
matcher . |
ResponseSpecification |
ResponseSpecification.time(org.hamcrest.Matcher<Long> matcher,
TimeUnit timeUnit)
Validate that the response time matches the supplied
matcher and time unit. |
Modifier and Type | Method and Description |
---|---|
ResponseSpecification |
ResponseSpecification.spec(ResponseSpecification responseSpecificationToMerge)
Expect that the response matches an entire specification.
|
Copyright © 2010–2022. All rights reserved.