|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.kristofa.test.http.AbstractHttpResponseProvider
public abstract class AbstractHttpResponseProvider
Abstract HttpResponseProvider that contains the following functionality:
HttpRequestMatchingFilter to perform matching.HttpResponseProvider it is probably a good idea to extend this class.
DefaultHttpResponseProvider,
FileHttpResponseProvider| Constructor Summary | |
|---|---|
AbstractHttpResponseProvider()
|
|
| Method Summary | |
|---|---|
protected void |
addExpected(HttpRequest request,
HttpResponseProxy responseProxy)
Adds an expected HttpRequest and response proxy combination. |
void |
addHttpRequestMatchingFilter(HttpRequestMatchingFilter filter)
Adds a HttpRequestMatchingFilter to the chain of http request matching
filters. |
HttpResponse |
getResponse(HttpRequest request)
Gets expected response for given request. |
protected void |
lazyInitializeExpectedRequestsAndResponses()
Override this method if you want to lazily initialize requests/responses. |
protected void |
resetState()
Clear expected request/responses as well as already received unexpected requests. |
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 AbstractHttpResponseProvider()
| Method Detail |
|---|
protected final void addExpected(HttpRequest request,
HttpResponseProxy responseProxy)
request - Expected http request.responseProxy - Response proxy which gives us access to http response.protected void lazyInitializeExpectedRequestsAndResponses()
getResponse(HttpRequest).
You can initialize expected requests and responses by calling
addExpected(HttpRequest, HttpResponseProxy).
protected final void resetState()
public final HttpResponse getResponse(HttpRequest request)
getResponse in interface HttpResponseProviderrequest - HttpRequest.
null in case we don't know given request.public final void addHttpRequestMatchingFilter(HttpRequestMatchingFilter filter)
HttpRequestMatchingFilter to the chain of http request matching
filters.
filter - HttpRequestMatchingFilter.
public final 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 | |||||||||