Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.github.kristofa.test.http;

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

Used with MockHttpServer.

Author(s):
kristof
See also:
MockHttpServer
public interface HttpResponseProvider {

    
Gets expected response for given request.

Parameters:
request HttpRequest.
Returns:
Response or null in case we don't know given request.
    HttpResponse getResponse(final HttpRequest request);

    
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.
    void verify() throws UnsatisfiedExpectationException;
New to GrepCode? Check out our FAQ X