List of usage examples for org.springframework.ui ExtendedModelMap asMap
@Override
public Map<String, Object> asMap()
From source file:org.springframework.test.web.portlet.server.result.ModelResultMatchers.java
private Map<String, Object> getModel(PortletMvcResult portletMvcResult) { ModelAndView mav = portletMvcResult.getModelAndView(); Map<String, Object> model = null; if (mav != null) { model = mav.getModel();// w w w. j a v a 2 s. c o m } else { if (portletMvcResult.getResponse() instanceof StateAwareResponse) { StateAwareResponse response = (StateAwareResponse) portletMvcResult.getResponse(); // check if there are action exceptions assertTrue( "No actionExceptions expected, but got: " + StringUtils.join(response .getRenderParameterMap().get(DispatcherPortlet.ACTION_EXCEPTION_RENDER_PARAMETER)), !response.getRenderParameterMap() .containsKey(DispatcherPortlet.ACTION_EXCEPTION_RENDER_PARAMETER)); // look for implicit model in session PortletSession session = portletMvcResult.getRequest().getPortletSession(false); if (session != null) { ExtendedModelMap implicitModel = (ExtendedModelMap) session .getAttribute(AnnotationMethodHandlerAdapter.IMPLICIT_MODEL_SESSION_ATTRIBUTE); if (implicitModel != null) { model = implicitModel.asMap(); } } } } assertTrue("No Model found", model != null); return model; }