com.github.kristofa.test.http
Interface HttpResponseProvider

All Known Implementing Classes:
DefaultHttpResponseProvider, FileHttpResponseProvider, SimpleHttpResponseProvider

public interface HttpResponseProvider

Provides responses for given http requests. Abstracts where the responses come from.

Used with MockHttpServer.

Author:
kristof
See Also:
MockHttpServer

Method Summary
 HttpResponse getResponse(HttpRequest request)
          Gets expected response for given request.
 void verify()
          Should be executed when all requests have been submitted.
 

Method Detail

getResponse

HttpResponse getResponse(HttpRequest request)
Gets expected response for given request.

Parameters:
request - HttpRequest.
Returns:
Response or null in case we don't know given request.

verify

void verify()
            throws UnsatisfiedExpectationException
Should be executed when all requests have been submitted. Checks if all expected requests have been requested.

Throws:
UnsatisfiedExpectationException - In case expectation were not as expected. See UnsatisfiedExpectationException.getMissingHttpRequests() and UnsatisfiedExpectationException.getUnexpectedHttpRequests() to get missing and unexpected requests.


Copyright © 2014. All Rights Reserved.