|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jayway.restassured.filter.log.ErrorLoggingFilter
public class ErrorLoggingFilter
A filter that'll print the response body if an error occurred (status code is between 400 and 500).
| Constructor Summary | |
|---|---|
ErrorLoggingFilter()
Log to system out |
|
ErrorLoggingFilter(PrintStream stream)
Instantiate a error logger using a specific print stream |
|
| Method Summary | |
|---|---|
static Filter |
errorLogger()
Create a new error logging filter without using the "new" operator. |
Response |
filter(FilterableRequestSpecification requestSpec,
FilterableResponseSpecification responseSpec,
FilterContext ctx)
Filter the incoming request and response specifications and outgoing response. |
static Filter |
logErrorsTo(PrintStream stream)
Create a new error logging filter without using the "new" operator. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ErrorLoggingFilter()
public ErrorLoggingFilter(PrintStream stream)
stream - The stream to log errors to.| Method Detail |
|---|
public static Filter errorLogger()
public static Filter logErrorsTo(PrintStream stream)
stream - The print stream to log to
public Response filter(FilterableRequestSpecification requestSpec,
FilterableResponseSpecification responseSpec,
FilterContext ctx)
FilterFilterContext.next(com.jayway.restassured.specification.FilterableRequestSpecification, com.jayway.restassured.specification.FilterableResponseSpecification) when you're done otherwise the request will not be delivered.
It's of course possible to abort the filter chain execution by returning a Response directly.
filter in interface FilterrequestSpec - The incoming request specresponseSpec - The incoming response specctx - The filter context. You need to call FilterContext.next(com.jayway.restassured.specification.FilterableRequestSpecification, com.jayway.restassured.specification.FilterableResponseSpecification) when you're done otherwise the request will not be delivered.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||