|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jayway.restassured.filter.log.ResponseLoggingFilter
public class ResponseLoggingFilter
A filter that'll print the response body if the response matches a given status code.
| Constructor Summary | |
|---|---|
ResponseLoggingFilter()
Log to system out for all status codes |
|
ResponseLoggingFilter(int statusCode)
Log to system out if response status code matches the given status code. |
|
ResponseLoggingFilter(LogDetail logDetail)
Instantiate a logger using the supplied log detail. |
|
ResponseLoggingFilter(LogDetail logDetail,
PrintStream stream)
Instantiate a logger using a specific print stream for all status codes |
|
ResponseLoggingFilter(LogDetail logDetail,
PrintStream stream,
int statusCode)
Instantiate a logger using a specific print stream for status codes matching the supplied status code. |
|
ResponseLoggingFilter(LogDetail logDetail,
PrintStream stream,
org.hamcrest.Matcher<Integer> matcher)
Instantiate a logger using a specific print stream for status codes matching the supplied matcher. |
|
ResponseLoggingFilter(org.hamcrest.Matcher<Integer> matcher)
Log to system out if response status code matches the given hamcrest matcher. |
|
ResponseLoggingFilter(PrintStream stream)
Instantiate a logger using a specific print stream for all status codes |
|
ResponseLoggingFilter(PrintStream stream,
int statusCode)
Instantiate a logger using a specific print stream for status codes matching the supplied status code. |
|
ResponseLoggingFilter(PrintStream stream,
org.hamcrest.Matcher<Integer> matcher)
Instantiate a logger using a specific print stream for status codes matching the supplied status code. |
|
| Method Summary | |
|---|---|
Response |
filter(FilterableRequestSpecification requestSpec,
FilterableResponseSpecification responseSpec,
FilterContext ctx)
Filter the incoming request and response specifications and outgoing response. |
static Filter |
logResponseIfStatusCodeIs(int statusCode)
Create a new logging filter without using the "new" operator. |
static Filter |
logResponseIfStatusCodeMatches(org.hamcrest.Matcher<Integer> matcher)
Create a new logging filter without using the "new" operator. |
static Filter |
logResponseTo(PrintStream stream)
Create a new logging filter without using the "new" operator. |
static Filter |
logResponseTo(PrintStream stream,
LogDetail logDetail)
Create a new logging filter without using the "new" operator. |
static Filter |
logResponseToIfMatches(PrintStream stream,
org.hamcrest.Matcher<Integer> matcher)
Create a new logging filter without using the "new" operator. |
static Filter |
responseLogger()
Create a new 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 ResponseLoggingFilter()
public ResponseLoggingFilter(int statusCode)
statusCode - The status codepublic ResponseLoggingFilter(org.hamcrest.Matcher<Integer> matcher)
matcher - The hamcrest matcherpublic ResponseLoggingFilter(LogDetail logDetail)
logDetail - The log detailpublic ResponseLoggingFilter(PrintStream stream)
stream - The stream to log errors to.
public ResponseLoggingFilter(LogDetail logDetail,
PrintStream stream)
logDetail - The log detailstream - The stream to log errors to.
public ResponseLoggingFilter(PrintStream stream,
int statusCode)
stream - The stream to log errors to.statusCode - The status code that must be present in the response if the response body is to be printed.
public ResponseLoggingFilter(PrintStream stream,
org.hamcrest.Matcher<Integer> matcher)
stream - The stream to log errors to.matcher - The matcher that must be fulfilled if the response body is to be printed.
public ResponseLoggingFilter(LogDetail logDetail,
PrintStream stream,
int statusCode)
logDetail - The log detailstream - The stream to log errors to.statusCode - The status code that must be present in the response if the response body is to be printed.
public ResponseLoggingFilter(LogDetail logDetail,
PrintStream stream,
org.hamcrest.Matcher<Integer> matcher)
logDetail - The log detailstream - The stream to log errors to.matcher - The matcher that must be fulfilled if the response body is to be printed.| Method Detail |
|---|
public static Filter responseLogger()
public static Filter logResponseTo(PrintStream stream)
stream - The print stream to log to
public static Filter logResponseTo(PrintStream stream,
LogDetail logDetail)
stream - The print stream to log tologDetail - The log detail
public static Filter logResponseIfStatusCodeMatches(org.hamcrest.Matcher<Integer> matcher)
matcher - The matcher that must be fulfilled in order for logging to occur
public static Filter logResponseIfStatusCodeIs(int statusCode)
statusCode - The status code that must be present in order for logging to occur
public static Filter logResponseToIfMatches(PrintStream stream,
org.hamcrest.Matcher<Integer> matcher)
stream - The print stream to log tomatcher - The matcher that must be fulfilled in order for logging to occur
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 | |||||||||