|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.kristofa.test.http.DefaultHttpResponseProvider
public class DefaultHttpResponseProvider
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.
| Constructor Summary | |
|---|---|
DefaultHttpResponseProvider(boolean ignoreAdditionalHeaders)
Creates a new instance. |
|
| Method Summary | |
|---|---|
HttpResponse |
getResponse(HttpRequest request)
Gets expected response for given request. |
void |
set(HttpRequest request,
HttpResponse response)
Sets a new request/response. |
void |
verify()
Should be executed when all requests have been submitted. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultHttpResponseProvider(boolean ignoreAdditionalHeaders)
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 |
|---|
public void set(HttpRequest request,
HttpResponse response)
request - HttpRequest.response - Response that should be returned for given request.public HttpResponse getResponse(HttpRequest request)
getResponse in interface HttpResponseProviderrequest - HttpRequest.
null in case we don't know given request.
public void verify()
throws UnsatisfiedExpectationException
verify in interface HttpResponseProviderUnsatisfiedExpectationException - In case expectation were not as expected. See
UnsatisfiedExpectationException.getMissingHttpRequests() and
UnsatisfiedExpectationException.getUnexpectedHttpRequests() to get missing and unexpected
requests.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||