if (session != null) {
request.setSession(session);
}
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain chain = new MockFilterChain();
VRaptorTestResult vRaptorTestResult = null;
Throwable applicationError = null;
try {
filter.doFilter(request, response, chain);
//TODO: find a better alternative
} catch (Exception e) {
applicationError = e.getCause();
response.setStatus(500);
}
Result vraptorResult = (Result) ((TargetInstanceProxy) result.get()).getTargetInstance();
Validator vraptorValidator = (Validator) ((TargetInstanceProxy) validator.get()).getTargetInstance();
vRaptorTestResult = new VRaptorTestResult(vraptorResult, response, request, vraptorValidator);
vRaptorTestResult.setApplicationError(applicationError);
return vRaptorTestResult;
}
@Override
public void setCookies(List<Cookie> cookies) {