@NotThreadSafe public abstract class AbstractRequestExpectationListBuilder extends Object implements RequestExpectationListBuilder
RequestExpectationListBuilder.
User has nothing to implement but RequestExpectationListBuilder.build() method.
| Constructor and Description |
|---|
AbstractRequestExpectationListBuilder() |
| Modifier and Type | Method and Description |
|---|---|
static ValueExpectation |
equalTo(String value)
Creates
equal to value expectations. |
static ValueExpectation |
equalToIgnoreCase(String value)
Creates
equal to ignoring letter case value expectations. |
static ValueExpectation |
equalToJson(String value)
Creates {equal to JSON} value expectation.
|
static ValueExpectation |
equalToXml(String value)
Creates {equal to XML} value expectation.
|
void |
expect(int times,
RequestExpectationBuilder requestExpectationBuilder)
Expect the same request multiple times.
|
void |
expect(RequestExpectationBuilder requestExpectationBuilder)
Adds a request expectation to this list.
|
List<RequestExpectation> |
getRequestExpectations()
Gets the list of request expectations.
|
List<HttpResponse> |
getResponses()
Gets the list of responses on actual requests.
|
static ValueExpectation |
matching(org.hamcrest.Matcher<String> valueMatcher)
Creates
matches value expectation. |
RequestExpectationBuilder |
request()
Returns new request expectation builder that user will use to specify his
expectations.
|
ResponseBuilder |
response()
Returns new response builder that user will use to describe a response on
the actual request.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuildpublic AbstractRequestExpectationListBuilder()
public List<RequestExpectation> getRequestExpectations()
RequestExpectationListBuildergetRequestExpectations in interface RequestExpectationListBuilderpublic List<HttpResponse> getResponses()
RequestExpectationListBuildergetResponses in interface RequestExpectationListBuilderpublic void expect(RequestExpectationBuilder requestExpectationBuilder)
RequestExpectationListBuilderexpect in interface RequestExpectationListBuilderrequestExpectationBuilder - Request expectation builder.public void expect(int times,
RequestExpectationBuilder requestExpectationBuilder)
A convenience method instead of calling
expect(RequestExpectationBuilder) multiple times.
times - Number of sequential requests with the same expectation.requestExpectationBuilder - Request expectation builder.NullPointerException - requestExpectationBuilder is null.IllegalArgumentException - times is not positive.public RequestExpectationBuilder request()
RequestExpectationListBuilderrequest in interface RequestExpectationListBuilderpublic ResponseBuilder response()
RequestExpectationListBuilderresponse in interface RequestExpectationListBuilderpublic static ValueExpectation equalToXml(String value)
value - Expected XML value. Null or empty values is allowed.public static ValueExpectation equalToJson(String value)
value - Expected JSON value. Null or empty values is allowed.public static ValueExpectation equalTo(String value)
equal to value expectations.value - Expected value.public static ValueExpectation equalToIgnoreCase(String value)
equal to ignoring letter case value expectations.value - Expected value.public static ValueExpectation matching(org.hamcrest.Matcher<String> valueMatcher)
matches value expectation.valueMatcher - Expected matching value.Copyright © 2016. All rights reserved.