Polishing

This commit is contained in:
Juergen Hoeller
2018-01-19 12:30:10 +01:00
parent 4c7414833b
commit 40127bd9ad
4 changed files with 16 additions and 28 deletions

View File

@@ -108,16 +108,13 @@ public abstract class AbstractRequestExpectationManager implements RequestExpect
/**
* Subclasses must implement the actual validation of the request
* matching to declared expectations.
* @deprecated as of 5.0.3 sub-classes should implement
* {@link #matchRequest(ClientHttpRequest)} instead and return only the matched
* expectation, leaving the call to create the response as a separate step
* (to be invoked by this class).
* @deprecated as of 5.0.3, subclasses should implement {@link #matchRequest(ClientHttpRequest)}
* instead and return only the matched expectation, leaving the call to create the response
* as a separate step (to be invoked by this class).
*/
@Deprecated
@Nullable
protected ClientHttpResponse validateRequestInternal(ClientHttpRequest request)
throws IOException {
protected ClientHttpResponse validateRequestInternal(ClientHttpRequest request) throws IOException {
return null;
}
@@ -132,9 +129,8 @@ public abstract class AbstractRequestExpectationManager implements RequestExpect
* @since 5.0.3
*/
protected RequestExpectation matchRequest(ClientHttpRequest request) throws IOException {
throw new java.lang.UnsupportedOperationException(
"It looks like neither the deprecated \"validateRequestInternal\"" +
"nor its replacement (this method) are implemented.");
throw new UnsupportedOperationException("It looks like neither the deprecated \"validateRequestInternal\"" +
"nor its replacement (this method) are implemented.");
}
@Override
@@ -197,15 +193,13 @@ public abstract class AbstractRequestExpectationManager implements RequestExpect
private final Set<RequestExpectation> expectations = new LinkedHashSet<>();
public Set<RequestExpectation> getExpectations() {
return this.expectations;
}
public void addAllExpectations(Collection<RequestExpectation> expectations) {
this.expectations.addAll(expectations);
}
public Set<RequestExpectation> getExpectations() {
return this.expectations;
}
/**
* Return a matching expectation, or {@code null} if none match.