Modifier and Type | Method and Description |
---|---|
protected HttpResponse |
AbstractClient.sendRequest(HttpRequest httpRequest) |
Modifier and Type | Method and Description |
---|---|
HttpResponse |
NettyHttpClient.sendRequest(HttpRequest httpRequest) |
HttpResponse |
NettyHttpClient.sendRequest(HttpRequest httpRequest,
InetSocketAddress remoteAddress) |
Modifier and Type | Method and Description |
---|---|
protected void |
MockServerRequestEncoder.encode(io.netty.channel.ChannelHandlerContext ctx,
HttpRequest httpRequest,
List<Object> out) |
Modifier and Type | Method and Description |
---|---|
String |
MockServerHttpRequestToFullHttpRequest.getURI(HttpRequest httpRequest) |
io.netty.handler.codec.http.FullHttpRequest |
MockServerHttpRequestToFullHttpRequest.mapMockServerResponseToHttpServletResponse(HttpRequest httpRequest) |
Modifier and Type | Method and Description |
---|---|
ProxyClient |
ProxyClient.clear(HttpRequest httpRequest)
Clear all recorded requests that match the httpRequest parameter
|
ProxyClient |
ProxyClient.dumpToLogAsJava(HttpRequest httpRequest)
Output Java code for creating matching requests and their responses as Expectations to the log.
|
ProxyClient |
ProxyClient.dumpToLogAsJSON(HttpRequest httpRequest)
Pretty-print the json for matching requests and their responses as Expectations to the log.
|
Expectation[] |
ProxyClient.retrieveAsExpectations(HttpRequest httpRequest)
Retrieve the recorded requests that match the httpRequest parameter as expectations, use null for the parameter to retrieve all requests
|
String |
ProxyClient.retrieveAsJSON(HttpRequest httpRequest)
Retrieve the recorded requests that match the httpRequest parameter as a JSON array, use null for the parameter to retrieve all requests
|
ProxyClient |
ProxyClient.verify(HttpRequest... httpRequests)
Verify a list of requests have been sent in the order specified for example:
mockServerClient
.verify(
request()
.withPath("/first_request")
.withBody("some_request_body"),
request()
.withPath("/second_request")
.withBody("some_request_body")
);
|
ProxyClient |
ProxyClient.verify(HttpRequest httpRequest,
VerificationTimes times)
Verify a request has been sent for example:
mockServerClient
.verify(
request()
.withPath("/some_path")
.withBody("some_request_body"),
VerificationTimes.exactly(3)
);
VerificationTimes supports multiple static factory methods:
once() - verify the request was only received once
exactly(n) - verify the request was only received exactly n times
atLeast(n) - verify the request was only received at least n times
|
Modifier and Type | Method and Description |
---|---|
HttpRequest |
HttpRequestSerializer.deserialize(String jsonHttpRequest) |
HttpRequest[] |
HttpRequestSerializer.deserializeArray(String jsonHttpRequests) |
Modifier and Type | Method and Description |
---|---|
Class<HttpRequest> |
HttpRequestSerializer.supportsType() |
Modifier and Type | Method and Description |
---|---|
String |
HttpRequestSerializer.serialize(HttpRequest... httpRequests) |
String |
HttpRequestSerializer.serialize(HttpRequest httpRequest) |
Modifier and Type | Method and Description |
---|---|
String |
HttpRequestSerializer.serialize(List<HttpRequest> httpRequests) |
Modifier and Type | Method and Description |
---|---|
String |
HttpRequestToCurlSerializer.toCurl(HttpRequest httpRequest,
InetSocketAddress remoteAddress) |
Modifier and Type | Method and Description |
---|---|
String |
HttpRequestToJavaSerializer.serializeAsJava(int numberOfSpacesToIndent,
HttpRequest httpRequest) |
Modifier and Type | Method and Description |
---|---|
String |
HttpRequestToJavaSerializer.serializeAsJava(int numberOfSpacesToIndent,
List<HttpRequest> httpRequests) |
Modifier and Type | Method and Description |
---|---|
HttpRequest |
HttpRequestDTO.buildObject() |
Constructor and Description |
---|
HttpRequestDTO(HttpRequest httpRequest) |
HttpRequestDTO(HttpRequest httpRequest,
Boolean not) |
Modifier and Type | Method and Description |
---|---|
void |
HttpRequestSerializer.serialize(HttpRequest httpRequest,
com.fasterxml.jackson.core.JsonGenerator jgen,
com.fasterxml.jackson.databind.SerializerProvider provider) |
Modifier and Type | Method and Description |
---|---|
HttpRequest[] |
MockServerClient.retrieveRecordedRequests(HttpRequest httpRequest)
Retrieve the recorded requests that match the httpRequest parameter, use null for the parameter to retrieve all requests
|
Modifier and Type | Method and Description |
---|---|
MockServerClient |
MockServerClient.clear(HttpRequest httpRequest)
Clear all expectations and logs that match the http
|
MockServerClient |
MockServerClient.clear(HttpRequest httpRequest,
MockServerClient.TYPE type)
Clear expectations, logs or both that match the http
|
MockServerClient |
MockServerClient.dumpToLog(HttpRequest httpRequest)
Pretty-print the json for all expectations that match the request to the log.
|
Expectation[] |
MockServerClient.retrieveExistingExpectations(HttpRequest httpRequest)
Retrieve the already setup expectations match the httpRequest parameter, use null for the parameter to retrieve all expectations
|
HttpRequest[] |
MockServerClient.retrieveRecordedRequests(HttpRequest httpRequest)
Retrieve the recorded requests that match the httpRequest parameter, use null for the parameter to retrieve all requests
|
MockServerClient |
MockServerClient.verify(HttpRequest... httpRequests)
Verify a list of requests have been sent in the order specified for example:
mockServerClient
.verify(
request()
.withPath("/first_request")
.withBody("some_request_body"),
request()
.withPath("/second_request")
.withBody("some_request_body")
);
|
MockServerClient |
MockServerClient.verify(HttpRequest httpRequest,
VerificationTimes times)
Verify a request has been sent for example:
mockServerClient
.verify(
request()
.withPath("/some_path")
.withBody("some_request_body"),
VerificationTimes.exactly(3)
);
VerificationTimes supports multiple static factory methods:
once() - verify the request was only received once
exactly(n) - verify the request was only received exactly n times
atLeast(n) - verify the request was only received at least n times
|
ForwardChainExpectation |
MockServerClient.when(HttpRequest httpRequest)
Specify an unlimited expectation that will respond regardless of the number of matching http
for example:
mockServerClient
.when(
request()
.withPath("/some_path")
.withBody("some_request_body")
)
.respond(
response()
.withBody("some_response_body")
.withHeaders(
new Header("responseName", "responseValue")
)
);
|
ForwardChainExpectation |
MockServerClient.when(HttpRequest httpRequest,
Times times)
Specify an limited expectation that will respond a specified number of times when the http is matched
for example:
mockServerClient
.when(
new HttpRequest()
.withPath("/some_path")
.withBody("some_request_body"),
Times.exactly(5)
)
.respond(
new HttpResponse()
.withBody("some_response_body")
.withHeaders(
new Header("responseName", "responseValue")
)
);
|
ForwardChainExpectation |
MockServerClient.when(HttpRequest httpRequest,
Times times,
TimeToLive timeToLive)
Specify an limited expectation that will respond a specified number of times when the http is matched
for example:
mockServerClient
.when(
new HttpRequest()
.withPath("/some_path")
.withBody("some_request_body"),
Times.exactly(5),
TimeToLive.exactly(TimeUnit.SECONDS, 120),
)
.respond(
new HttpResponse()
.withBody("some_response_body")
.withHeaders(
new Header("responseName", "responseValue")
)
);
|
Modifier and Type | Method and Description |
---|---|
protected void |
EchoServerHandler.channelRead0(io.netty.channel.ChannelHandlerContext ctx,
HttpRequest request) |
Modifier and Type | Method and Description |
---|---|
HttpRequest |
Filters.applyOnRequestFilters(HttpRequest httpRequest) |
HttpRequest |
RequestResponseLogFilter.onRequest(HttpRequest httpRequest) |
HttpRequest |
RequestLogFilter.onRequest(HttpRequest httpRequest) |
HttpRequest |
RequestFilter.onRequest(HttpRequest httpRequest) |
HttpRequest |
HopByHopHeaderFilter.onRequest(HttpRequest httpRequest) |
Modifier and Type | Method and Description |
---|---|
List<HttpRequest> |
RequestLogFilter.httpRequests(HttpRequest httpRequest) |
List<HttpRequest> |
RequestLogFilter.retrieve(HttpRequest httpRequestToMatch) |
Modifier and Type | Method and Description |
---|---|
HttpRequest |
Filters.applyOnRequestFilters(HttpRequest httpRequest) |
HttpResponse |
Filters.applyOnResponseFilters(HttpRequest httpRequest,
HttpResponse httpResponse) |
void |
RequestResponseLogFilter.clear(HttpRequest httpRequest) |
void |
RequestLogFilter.clear(HttpRequest httpRequest) |
void |
RequestResponseLogFilter.dumpToLog(HttpRequest httpRequest,
boolean asJava) |
List<HttpRequest> |
RequestLogFilter.httpRequests(HttpRequest httpRequest) |
List<HttpResponse> |
RequestResponseLogFilter.httpResponses(HttpRequest httpRequest) |
HttpRequest |
RequestResponseLogFilter.onRequest(HttpRequest httpRequest) |
HttpRequest |
RequestLogFilter.onRequest(HttpRequest httpRequest) |
HttpRequest |
RequestFilter.onRequest(HttpRequest httpRequest) |
HttpRequest |
HopByHopHeaderFilter.onRequest(HttpRequest httpRequest) |
HttpResponse |
ResponseFilter.onResponse(HttpRequest httpRequest,
HttpResponse httpResponse) |
HttpResponse |
RequestResponseLogFilter.onResponse(HttpRequest httpRequest,
HttpResponse httpResponse) |
HttpResponse |
RequestLogFilter.onResponse(HttpRequest httpRequest,
HttpResponse httpResponse) |
List<HttpRequest> |
RequestLogFilter.retrieve(HttpRequest httpRequestToMatch) |
List<Expectation> |
RequestResponseLogFilter.retrieveExpectations(HttpRequest httpRequest) |
Filters |
Filters.withFilter(HttpRequest httpRequest,
Filter filter) |
Modifier and Type | Field and Description |
---|---|
static List<HttpRequest> |
StaticTestExpectationCallback.httpRequests |
Modifier and Type | Method and Description |
---|---|
HttpResponse |
StaticTestExpectationCallback.handle(HttpRequest httpRequest) |
HttpResponse |
PrecannedTestExpectationCallback.handle(HttpRequest httpRequest) |
Modifier and Type | Method and Description |
---|---|
static Expectation |
AbstractClientServerIntegrationTest.expectation(HttpRequest httpRequest) |
protected HttpResponse |
AbstractClientServerIntegrationTest.makeRequest(HttpRequest httpRequest) |
protected HttpResponse |
AbstractClientServerIntegrationTest.makeRequest(HttpRequest httpRequest,
Collection<String> headersToIgnore) |
protected void |
AbstractClientServerIntegrationTest.verifyRequestMatches(HttpRequest[] httpRequests,
HttpRequest... httpRequestMatchers) |
protected void |
AbstractClientServerIntegrationTest.verifyRequestMatches(HttpRequest[] httpRequests,
HttpRequest... httpRequestMatchers) |
Modifier and Type | Method and Description |
---|---|
HttpRequest |
HttpServletRequestToMockServerRequestDecoder.mapHttpServletRequestToMockServerRequest(javax.servlet.http.HttpServletRequest httpServletRequest) |
Modifier and Type | Method and Description |
---|---|
boolean |
HttpRequestMatcher.matches(HttpRequest httpRequest) |
boolean |
HttpRequestMatcher.matches(HttpRequest httpRequest,
boolean logMatchResults) |
HttpRequestMatcher |
MatcherBuilder.transformsToMatcher(HttpRequest httpRequest) |
Constructor and Description |
---|
HttpRequestMatcher(HttpRequest httpRequest) |
Modifier and Type | Method and Description |
---|---|
HttpRequest |
Expectation.getHttpRequest() |
Modifier and Type | Method and Description |
---|---|
void |
MockServerMatcher.clear(HttpRequest httpRequest) |
void |
HttpStateHandler.clear(HttpRequest request) |
boolean |
Expectation.contains(HttpRequest httpRequest) |
void |
HttpStateHandler.dumpExpectationsToLog(HttpRequest request) |
void |
HttpStateHandler.dumpRecordedRequestResponsesToLog(HttpRequest request) |
void |
MockServerMatcher.dumpToLog(HttpRequest httpRequest,
boolean asJava) |
boolean |
Expectation.matches(HttpRequest httpRequest) |
String |
HttpStateHandler.retrieve(HttpRequest request) |
Action |
MockServerMatcher.retrieveAction(HttpRequest httpRequest) |
List<Expectation> |
MockServerMatcher.retrieveExpectations(HttpRequest httpRequest) |
Expectation |
MockServerMatcher.when(HttpRequest httpRequest) |
Expectation |
MockServerMatcher.when(HttpRequest httpRequest,
Times times,
TimeToLive timeToLive) |
Constructor and Description |
---|
Expectation(HttpRequest httpRequest,
Times times,
TimeToLive timeToLive) |
Modifier and Type | Method and Description |
---|---|
HttpResponse |
HttpCallbackActionHandler.handle(HttpClassCallback httpClassCallback,
HttpRequest httpRequest) |
HttpResponse |
HttpForwardActionHandler.handle(HttpForward httpForward,
HttpRequest httpRequest) |
HttpResponse |
ExpectationCallback.handle(HttpRequest httpRequest)
Called for every request when expectation condition has been satisfied.
|
HttpResponse |
HttpResponseTemplateActionHandler.handle(HttpTemplate httpTemplate,
HttpRequest httpRequest) |
HttpResponse |
ActionHandler.processAction(Action action,
HttpRequest httpRequest) |
Modifier and Type | Method and Description |
---|---|
protected void |
MockServerHandler.channelRead0(io.netty.channel.ChannelHandlerContext ctx,
HttpRequest request) |
Modifier and Type | Method and Description |
---|---|
void |
WebSocketClientRegistry.sendClientMessage(String clientId,
HttpRequest httpRequest) |
Modifier and Type | Method and Description |
---|---|
HttpRequest |
HttpRequest.clone() |
HttpRequest |
HttpRequest.replaceHeader(Header header)
Adds one header to match on as a Header object where the header values list can be a list of strings or regular expressions
(for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
|
static HttpRequest |
HttpRequest.request() |
static HttpRequest |
HttpRequest.request(String path) |
HttpRequest |
HttpRequest.withBody(Body body)
The body match rules on such as using one of the Body subclasses as follows:
|
HttpRequest |
HttpRequest.withBody(byte[] body)
The body to match on as binary data such as a pdf or image
|
HttpRequest |
HttpRequest.withBody(String body)
The exact string body to match on such as "this is an exact string body"
|
HttpRequest |
HttpRequest.withBody(String body,
Charset charset)
The exact string body to match on such as "this is an exact string body"
|
HttpRequest |
HttpRequest.withCookie(Cookie cookie)
Adds one cookie to match on as a Cookie object where the cookie values list can be a list of strings or regular expressions
(for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
|
HttpRequest |
HttpRequest.withCookie(NottableString name,
NottableString value)
Adds one cookie to match on or to not match on using the NottableString, each NottableString can either be a positive matching value,
such as string("match"), or a value to not match on, such as not("do not match"), the string values passed to the NottableString
can be a plain string or a regex (for more details of the supported regex syntax see
http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
|
HttpRequest |
HttpRequest.withCookie(String name,
String value)
Adds one cookie to match on, which can specified using either plain strings or regular expressions
(for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
|
HttpRequest |
HttpRequest.withCookies(Cookie... cookies)
The cookies to match on as a varags Cookie objects where the values or keys of each cookie can be either a string or a regex
(for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
|
HttpRequest |
HttpRequest.withCookies(List<Cookie> cookies)
The cookies to match on as a list of Cookie objects where the values or keys of each cookie can be either a string or a regex
(for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
|
HttpRequest |
HttpRequest.withHeader(Header header)
Adds one header to match on as a Header object where the header values list can be a list of strings or regular expressions
(for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
|
HttpRequest |
HttpRequest.withHeader(NottableString name,
NottableString... values)
Adds one header to match on or to not match on using the NottableString, each NottableString can either be a positive matching value,
such as string("match"), or a value to not match on, such as not("do not match"), the string values passed to the NottableString
can also be a plain string or a regex (for more details of the supported regex syntax
see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
|
HttpRequest |
HttpRequest.withHeader(String name,
String... values)
Adds one header to match which can specified using plain strings or regular expressions
(for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
|
HttpRequest |
HttpRequest.withHeaders(Header... headers)
The headers to match on as a varags of Header objects where the values or keys of each header can be either a string or a regex
(for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
|
HttpRequest |
HttpRequest.withHeaders(List<Header> headers)
The headers to match on as a list of Header objects where the values or keys of each header can be either a string or a regex
(for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
|
HttpRequest |
HttpRequest.withKeepAlive(Boolean isKeepAlive)
Match on whether the request was made using an HTTP persistent connection, also called HTTP keep-alive, or HTTP connection reuse
|
HttpRequest |
HttpRequest.withMethod(NottableString method)
The HTTP method all method except a specific value using the "not" operator,
for example this allows operations such as not("GET")
|
HttpRequest |
HttpRequest.withMethod(String method)
The HTTP method to match on such as "GET" or "POST"
|
HttpRequest |
HttpRequest.withPath(NottableString path)
The path to not match on for example not("/some_mocked_path") with match any path not equal to "/some_mocked_path",
the servlet context path is ignored for matching and should not be specified here
regex values are also supported such as not(".*_path"), see
http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html for full details of the supported regex syntax
|
HttpRequest |
HttpRequest.withPath(String path)
The path to match on such as "/some_mocked_path" any servlet context path is ignored for matching and should not be specified here
regex values are also supported such as ".*_path", see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html
for full details of the supported regex syntax
|
HttpRequest |
HttpRequest.withQueryStringParameter(NottableString name,
NottableString... values)
Adds one query string parameter to match on or to not match on using the NottableString, each NottableString can either be a positive matching
value, such as string("match"), or a value to not match on, such as not("do not match"), the string values passed to the NottableString
can also be a plain string or a regex (for more details of the supported regex syntax
see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
|
HttpRequest |
HttpRequest.withQueryStringParameter(Parameter parameter)
Adds one query string parameter to match on as a Parameter object where the parameter values list can be a list of strings or regular expressions
(for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
|
HttpRequest |
HttpRequest.withQueryStringParameter(String name,
String... values)
Adds one query string parameter to match which can specified using plain strings or regular expressions
(for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
|
HttpRequest |
HttpRequest.withQueryStringParameters(List<Parameter> parameters)
The query string parameters to match on as a list of Parameter objects where the values or keys of each parameter can be either a string or a regex
(for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
|
HttpRequest |
HttpRequest.withQueryStringParameters(Map<String,List<String>> parameters)
The query string parameters to match on as a Map
|
HttpRequest |
HttpRequest.withQueryStringParameters(Parameter... parameters)
The query string parameters to match on as a varags Parameter objects where the values or keys of each parameter can be either a string or a regex
(for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
|
HttpRequest |
HttpRequest.withSecure(Boolean isSsl)
Match on whether the request was made over SSL (i.e.
|
Modifier and Type | Method and Description |
---|---|
protected void |
HttpProxyHandler.channelRead0(io.netty.channel.ChannelHandlerContext ctx,
HttpRequest request) |
Modifier and Type | Method and Description |
---|---|
HttpRequest |
MockServerRequestDecoder.decode(io.netty.handler.codec.http.FullHttpRequest fullHttpRequest) |
Modifier and Type | Method and Description |
---|---|
HttpResponse |
TemplateEngine.executeTemplate(String template,
HttpRequest httpRequest) |
Modifier and Type | Method and Description |
---|---|
HttpResponse |
JavaScriptTemplateEngine.executeTemplate(String template,
HttpRequest httpRequest) |
Modifier and Type | Method and Description |
---|---|
HttpResponse |
VelocityTemplateEngine.executeTemplate(String template,
HttpRequest httpRequest) |
Constructor and Description |
---|
HttpRequestTemplateObject(HttpRequest httpRequest) |
Modifier and Type | Method and Description |
---|---|
HttpRequest |
Verification.getHttpRequest() |
Modifier and Type | Method and Description |
---|---|
List<HttpRequest> |
VerificationSequence.getHttpRequests() |
Modifier and Type | Method and Description |
---|---|
Verification |
Verification.withRequest(HttpRequest httpRequest) |
VerificationSequence |
VerificationSequence.withRequests(HttpRequest... httpRequests) |
Modifier and Type | Method and Description |
---|---|
VerificationSequence |
VerificationSequence.withRequests(List<HttpRequest> httpRequests) |
Copyright © 2018. All rights reserved.