return mockResponse;
}
public RestMockResult dispatchRequest(RestMockRequest request) throws DispatchException {
if (getMockResponseCount() == 0) {
throw new DispatchException("Missing MockResponse(s) in MockOperation [" + getName() + "]");
}
try {
RestMockResult result = new RestMockResult(request);
MockResponse mockResponse = getDispatcher().selectMockResponse(request, result);
result.setMockResponse(mockResponse);
result.setMockOperation(this);
if (mockResponse == null) {
mockResponse = getMockResponseByName(this.getDefaultResponse());
}
if (mockResponse == null) {
throw new DispatchException("Failed to find MockResponse");
}
result.setMockResponse(mockResponse);
mockResponse.execute(request, result);
return result;
} catch (Exception e) {
throw new DispatchException(e);
}
}