assertEquals(context, model.get("flowRequestContext"));
assertNull(model.get(BindingResult.MODEL_KEY_PREFIX + "bindBean"));
}
public void testRenderWithBindingModel() throws Exception {
MockRequestControlContext context = new MockRequestControlContext();
context.setCurrentState(new ViewState(context.getRootFlow(), "test", new StubViewFactory()));
Object bindBean = new BindBean();
StaticExpression modelObject = new StaticExpression(bindBean);
modelObject.setExpressionString("bindBean");
context.getCurrentState().getAttributes().put("model", modelObject);
context.getFlowScope().put("bindBean", bindBean);
context.getMockExternalContext().setNativeContext(new MockServletContext());
context.getMockExternalContext().setNativeRequest(new MockHttpServletRequest());
context.getMockExternalContext().setNativeResponse(new MockHttpServletResponse());
context.getMockFlowExecutionContext().setKey(new MockFlowExecutionKey("c1v1"));
org.springframework.web.servlet.View mvcView = new MockView();
AbstractMvcView view = new MockMvcView(mvcView, context);
view.setExpressionParser(DefaultExpressionParserFactory.getExpressionParser());
view.setConversionService(new DefaultConversionService());
view.render();
assertEquals(context.getFlowScope().get("bindBean"), model.get("bindBean"));
BindingModel bm = (BindingModel) model.get(BindingResult.MODEL_KEY_PREFIX + "bindBean");
assertNotNull(bm);
assertEquals(null, bm.getFieldValue("stringProperty"));
assertEquals("3", bm.getFieldValue("integerProperty"));
assertEquals("2008-01-01", bm.getFieldValue("dateProperty"));