com.github.kristofa.test.http
Interface HttpRequestMatchingFilter

All Known Implementing Classes:
AbstractHttpRequestMatchingFilter, AllExceptContentTypeHeaderFilter, AllExceptOriginalHeadersFilter

public interface HttpRequestMatchingFilter

A HttpRequestMatchingFilter contains logic to deal with expected differences between 2 requests and brings them in-line so that they can potentially match.

If we have a request that contains a http header entry that can differ from request to request, for example a user token, the HttpRequestMatchingFilter can create copies of both input requests and remove the header entry of both or set a common value so they can match.

Http Request Matching Filters can be chained. Each filter working on the output of the previous one. This is implemented in AbstractHttpResponseProvider.

Author:
kristof
See Also:
AbstractHttpResponseProvider, FileHttpResponseProvider, AllExceptContentTypeHeaderFilter, AllExceptOriginalHeadersFilter

Method Summary
 HttpRequestMatchingContext filter(HttpRequestMatchingContext context)
          Filter/transform input http requests and response if needed.
 HttpRequestMatchingFilter next()
          Get next instance in chain.
 void setNext(HttpRequestMatchingFilter filter)
          Http request match filters can be chained.
 

Method Detail

filter

HttpRequestMatchingContext filter(HttpRequestMatchingContext context)
Filter/transform input http requests and response if needed.

Parameters:
context - Input context. Contains either original request, non matching other request and original response OR context modified by HttpRequestMatchingFilter earlier in the chain.
Returns:
Same or modified context.

setNext

void setNext(HttpRequestMatchingFilter filter)
Http request match filters can be chained.

Parameters:
filter - Set next instance in chain.

next

HttpRequestMatchingFilter next()
Get next instance in chain.

Returns:
Next instance in chain. Can be null.


Copyright © 2014. All Rights Reserved.