public class SimpleHttpResponseProvider extends AbstractHttpResponseProvider
HttpResponseProvider that keeps expected request/responses in memory. Its purpose is to match simple requests that
can be easily programmatically defined in code. It supports matching:
MockHttpServer| Constructor and Description |
|---|
SimpleHttpResponseProvider() |
| Modifier and Type | Method and Description |
|---|---|
SimpleHttpResponseProvider |
expect(Method method,
String path)
Provide an expected request without content.
|
SimpleHttpResponseProvider |
expect(Method method,
String path,
String contentType,
String requestEntity)
Provide an expected request with content.
|
void |
reset()
Reset the response provider to its original state
|
SimpleHttpResponseProvider |
respondWith(int httpCode,
String contentType,
String requestEntity)
Provide expected response for latest given request.
|
addExpected, addHttpRequestMatchingFilter, getResponse, lazyInitializeExpectedRequestsAndResponses, resetState, verifypublic SimpleHttpResponseProvider expect(Method method, String path, String contentType, String requestEntity)
method - HTTP method.path - Path. Path can contain query parameters, eg: path?a=b&b=ccontentType - Content type.requestEntity - Request entity as string.SimpleHttpResponseProvider. Allows chaining calls.public SimpleHttpResponseProvider expect(Method method, String path)
method - HTTP method.path - Path. Path can contain query parameters, eg: path?a=b&b=cSimpleHttpResponseProvider. Allows chaining calls.public SimpleHttpResponseProvider respondWith(int httpCode, String contentType, String requestEntity)
httpCode - Http response code.contentType - Content type.requestEntity - Data.SimpleHttpResponseProvider. Allows chaining calls.public void reset()
Copyright © 2014. All Rights Reserved.