use of org.apereo.cas.services.web.view.AbstractCasView in project cas by apereo.
the class Cas30ResponseViewTests method renderView.
protected Map<?, ?> renderView() throws Exception {
final ModelAndView modelAndView = this.getModelAndViewUponServiceValidationWithSecurePgtUrl();
LOGGER.debug("Retrieved model and view [{}]", modelAndView.getModel());
final MockHttpServletRequest req = new MockHttpServletRequest(new MockServletContext());
req.setAttribute(RequestContext.WEB_APPLICATION_CONTEXT_ATTRIBUTE, new GenericWebApplicationContext(req.getServletContext()));
final ProtocolAttributeEncoder encoder = new DefaultCasProtocolAttributeEncoder(this.servicesManager, CipherExecutor.noOpOfStringToString());
final View viewDelegated = new View() {
@Override
public String getContentType() {
return MediaType.TEXT_HTML_VALUE;
}
@Override
public void render(final Map<String, ?> map, final HttpServletRequest request, final HttpServletResponse response) {
LOGGER.warn("Setting attribute [{}]", map.keySet());
map.forEach(request::setAttribute);
}
};
final AbstractCasView view = getCasViewToRender(encoder, viewDelegated);
final MockHttpServletResponse resp = new MockHttpServletResponse();
view.render(modelAndView.getModel(), req, resp);
return getRenderedViewModelMap(req);
}
Aggregations