Posts

Showing posts from March, 2013

Spring Webflow: Unit testing with Parent flows

Recently I had to test a webflow that extended a parent webflow. The documentation didn't offer much in the way of help but did suggest that you use getModelResources() method to register additional flows from the AbstractXmlFlowExecutionTests class @Override protected FlowDefinitionResource[] getModelResources(FlowDefinitionResourceFactory resourceFactory) { FlowDefinitionResource[] flowDefinitionResources = new FlowDefinitionResource[1]; flowDefinitionResources[0] = resourceFactory.createFileResource("src/main/webapp/WEB-INF/flows/base-flow.xml"); return flowDefinitionResources; } Great! Or so I thought... Below is how I extended the flow to use the base parent flow. I registered the base-flow.xml in the flowRegistry like below and I assumed that the AbstractXmlFlowExecutionTests class would register the flow as id="base" ... This was the wrong assumption, after debugging I no...