com.jayway.restassured.filter
Interface Filter

All Known Subinterfaces:
AuthFilter
All Known Implementing Classes:
ErrorLoggingFilter, FormAuthFilter, RequestLoggingFilter, ResponseLoggingFilter, RootFilter

public interface Filter

A filter allows you to inspect and alter a request before it's actually committed and also inspect and alter the response before it's returned to the expectations. You can regard it as an "around advice" in AOP terms. Filters can be used to implement custom authentication schemes, session management, logging etc.


Method Summary
 Response filter(FilterableRequestSpecification requestSpec, FilterableResponseSpecification responseSpec, FilterContext ctx)
          Filter the incoming request and response specifications and outgoing response.
 

Method Detail

filter

Response filter(FilterableRequestSpecification requestSpec,
                FilterableResponseSpecification responseSpec,
                FilterContext ctx)
Filter the incoming request and response specifications and outgoing response. 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. It's of course possible to abort the filter chain execution by returning a Response directly.

Parameters:
requestSpec - The incoming request spec
responseSpec - The incoming response spec
ctx - 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.
Returns:
The response


Copyright © 2010-2011. All Rights Reserved.