public class Response
This class is using for HTTP/HTTPS response validation and processing.
| Modifier and Type | Field and Description |
|---|---|
Logger |
logger |
io.restassured.internal.RequestSpecificationImpl |
request |
io.restassured.response.Response |
response |
| Constructor and Description |
|---|
Response()
This class is using for HTTP/HTTPS response validation and processing.
|
Response(io.restassured.internal.RequestSpecificationImpl request,
io.restassured.response.Response response) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
as(java.lang.Class<T> cls)
Deserialize responseSpecification body as your model class.
|
<T> T |
as(java.lang.Class<T> cls,
io.restassured.mapper.ObjectMapper objectMapper)
Deserialize responseSpecification body as your model class.
|
<T> T |
as(java.lang.Class<T> cls,
io.restassured.mapper.ObjectMapperType objectMapperType)
Deserialize responseSpecification body as your model class.
|
Logger |
assertThat(Verifier verifier,
com.github.aivancioglo.resttest.verifiers.Verifier verifiers)
Making responseSpecification validation.
|
Logger |
assertThat(int code,
com.github.aivancioglo.resttest.verifiers.Verifier verifiers)
Making responseSpecification validation.
|
Logger |
assertThat(StatusCode statusCode,
com.github.aivancioglo.resttest.verifiers.Verifier verifiers)
Making responseSpecification validation.
|
Logger |
assertThat(int code,
java.lang.String jsonSchema,
com.github.aivancioglo.resttest.verifiers.Verifier verifiers)
Making responseSpecification validation.
|
Logger |
assertThat(StatusCode statusCode,
java.lang.String jsonSchema,
com.github.aivancioglo.resttest.verifiers.Verifier verifiers)
Making responseSpecification validation.
|
java.lang.String |
contentType()
Get the content type of the response
|
java.lang.String |
getBody()
For getting body of last responseSpecification as string.
|
Logger |
getLogger() |
io.restassured.internal.RequestSpecificationImpl |
getRequest() |
io.restassured.response.Response |
getResponse() |
int |
getStatusCode()
For getting responseSpecification code of last responseSpecification.
|
java.lang.String |
header(java.lang.String name)
Get responseSpecification header by name.
|
java.util.List<io.restassured.http.Header> |
headers()
Returns list of headers.
|
boolean |
isHeaderExist(java.lang.String name)
Check if header exist.
|
Response |
log(LogType type)
Response logging.
|
Response |
log()
Response logging.
|
<T> T |
path(java.lang.String path1,
java.lang.String path2)
Extract value by JSON path.
|
void |
setLogger(Logger p) |
void |
setRequest(io.restassured.internal.RequestSpecificationImpl p) |
void |
setResponse(io.restassured.response.Response p) |
public io.restassured.internal.RequestSpecificationImpl request
public io.restassured.response.Response response
public Logger logger
public Response()
This class is using for HTTP/HTTPS response validation and processing.
public Response(io.restassured.internal.RequestSpecificationImpl request,
io.restassured.response.Response response)
public io.restassured.internal.RequestSpecificationImpl getRequest()
public void setRequest(io.restassured.internal.RequestSpecificationImpl p)
public io.restassured.response.Response getResponse()
public void setResponse(io.restassured.response.Response p)
public Logger getLogger()
public void setLogger(Logger p)
public Logger assertThat(Verifier verifier, com.github.aivancioglo.resttest.verifiers.Verifier verifiers)
Making responseSpecification validation.
verifiers - for responseSpecification validation.public Logger assertThat(int code, com.github.aivancioglo.resttest.verifiers.Verifier verifiers)
Making responseSpecification validation.
code - of responseSpecification.verifiers - for responseSpecification validation.public Logger assertThat(StatusCode statusCode, com.github.aivancioglo.resttest.verifiers.Verifier verifiers)
Making responseSpecification validation.
statusCode - of responseSpecification.verifiers - for responseSpecification validation.public Logger assertThat(int code, java.lang.String jsonSchema, com.github.aivancioglo.resttest.verifiers.Verifier verifiers)
Making responseSpecification validation.
code - of responseSpecification.jsonSchema - for responseSpecification validation.verifiers - for responseSpecification validation.public Logger assertThat(StatusCode statusCode, java.lang.String jsonSchema, com.github.aivancioglo.resttest.verifiers.Verifier verifiers)
Making responseSpecification validation.
statusCode - of responseSpecification.jsonSchema - for responseSpecification validation.verifiers - for responseSpecification validation.public Response log()
Response logging.
public int getStatusCode()
For getting responseSpecification code of last responseSpecification.
public java.lang.String getBody()
For getting body of last responseSpecification as string.
public <T> T as(java.lang.Class<T> cls)
Deserialize responseSpecification body as your model class.
T - is responseSpecification model.cls - that of your module.public <T> T as(java.lang.Class<T> cls,
io.restassured.mapper.ObjectMapper objectMapper)
Deserialize responseSpecification body as your model class.
T - is responseSpecification model.cls - that of your module.objectMapper - for response body deserializing.public <T> T as(java.lang.Class<T> cls,
io.restassured.mapper.ObjectMapperType objectMapperType)
Deserialize responseSpecification body as your model class.
T - is responseSpecification model.cls - that of your module.objectMapperType - for response body deserializing.public <T> T path(java.lang.String path1,
java.lang.String path2)
Extract value by JSON path.
T - is returning type.path1 - JSON path1.path2 - JSON path2.public java.lang.String header(java.lang.String name)
Get responseSpecification header by name.
name - of header.public java.util.List<io.restassured.http.Header> headers()
Returns list of headers.
public java.lang.String contentType()
Get the content type of the response
public boolean isHeaderExist(java.lang.String name)
Check if header exist.
name - of header.