public void testFormActionValidatorMethod() {
ClassPathResource resource = new ClassPathResource("flow-formaction-validatormethod.xml", getClass());
XmlFlowModelBuilder builder = new XmlFlowModelBuilder(resource, registry);
DefaultFlowModelHolder holder = new DefaultFlowModelHolder(builder);
FlowModelFlowBuilder flowBuilder = new FlowModelFlowBuilder(holder);
FlowAssembler assembler = new FlowAssembler(flowBuilder, new MockFlowBuilderContext("flow"));
Flow flow = assembler.assembleFlow();
FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(new FlowExecutionListenerAdapter() {
public void viewRendering(RequestContext context, View view, StateDefinition viewState) {
if (context.getCurrentEvent() != null && context.getCurrentEvent().getId().equals("submit")) {
BindingResult result = (BindingResult) context.getFlashScope().get(