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(
"org.springframework.validation.BindingResult.formBean");
assertEquals(1, result.getErrorCount());