com.github.kristofa.test.http
Class DefaultHttpResponseProvider

java.lang.Object
  extended by com.github.kristofa.test.http.AbstractHttpResponseProvider
      extended by com.github.kristofa.test.http.DefaultHttpResponseProvider
All Implemented Interfaces:
HttpResponseProvider

public class DefaultHttpResponseProvider
extends AbstractHttpResponseProvider

A HttpResponseProvider that supports http request with all properties. It supports any http header you define as opposed to SimpleHttpResponseProvider which only supports Content-Type.

Author:
kristof

Constructor Summary
DefaultHttpResponseProvider(boolean ignoreAdditionalHeaders)
          Creates a new instance.
 
Method Summary
 void set(HttpRequest request, HttpResponse response)
          Sets a new request/response.
 
Methods inherited from class com.github.kristofa.test.http.AbstractHttpResponseProvider
addExpected, addHttpRequestMatchingFilter, getResponse, lazyInitializeExpectedRequestsAndResponses, resetState, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHttpResponseProvider

public DefaultHttpResponseProvider(boolean ignoreAdditionalHeaders)
Creates a new instance.

Parameters:
ignoreAdditionalHeaders - In some cases you might want to ignore additional http headers and only want to check some headers. For example sometimes a HTTP client adds custom identification headers you might not be interested in. If this is the case and you don't necessary want a full match then specific true. In case you specify false all http headers will be matched.
Method Detail

set

public void set(HttpRequest request,
                HttpResponse response)
Sets a new request/response.

Parameters:
request - HttpRequest.
response - Response that should be returned for given request.


Copyright © 2014. All Rights Reserved.