Add MockMvcClientHttpRequestFactory

Issue: SPR-9917
This commit is contained in:
Rossen Stoyanchev
2012-11-26 14:23:12 -05:00
parent f30d33d32e
commit 3a50dafc90
5 changed files with 201 additions and 9 deletions

View File

@@ -74,19 +74,19 @@ public class MockClientHttpRequest extends MockHttpOutputMessage implements Clie
this.clientHttpResponse = clientHttpResponse;
}
/**
* Whether the execute method was invoked.
*/
public boolean isExecuted() {
return this.executed;
}
/**
* Sets the {@link #isExecuted() executed} flag to true and returns the
* configured {@link #setResponse(ClientHttpResponse) response}.
*/
public ClientHttpResponse execute() throws IOException {
public final ClientHttpResponse execute() throws IOException {
this.executed = true;
return executeInternal();
}
/**
* Override this method to execute the request and provdie a response.
*/
protected ClientHttpResponse executeInternal() throws IOException {
return this.clientHttpResponse;
}