com.github.kristofa.test.http
Interface HttpResponseProxy

All Known Implementing Classes:
DefaultHttpResponseProxy

public interface HttpResponseProxy

Http responses can be large and they are only needed when the corresponding http request matched. So we don't need and don't want to keep all responses for expected http requests in memory.

This proxy knows how to fetch and build the http response but does not necessary keep it in memory. It can fetch the response lazily.

It also keeps track if the response has already been consumed or not. In that way we can support different responses for same request and we can check if we have the exact amount of expected calls for a request.

Author:
kristof
See Also:
AbstractHttpResponseProvider

Method Summary
 HttpResponse consume()
          Consumes HttpResponse.
 boolean consumed()
          Indicates if the HttpResponse has already been consumed.
 HttpResponse getResponse()
          Gets HttpResponse.
 

Method Detail

consumed

boolean consumed()
Indicates if the HttpResponse has already been consumed.

Returns:
true in case consume() has already been called before or false in case it has not been called yet.

getResponse

HttpResponse getResponse()
Gets HttpResponse.

Returns:
HttpResponse.

consume

HttpResponse consume()
Consumes HttpResponse.

Returns:
HttpResponse.


Copyright © 2014. All Rights Reserved.