14.4. Registering flow dependencies
Prev | 14. Testing flows | Next

## 14.4. Registering flow dependencies

If your flow has dependencies on externally managed services, also override `configureFlowBuilderContext(MockFlowBuilderContext)` to register stubs or mocks of those services:

    @Override
    protected void configureFlowBuilderContext(MockFlowBuilderContext builderContext) {
        builderContext.registerBean("bookingService", new StubBookingService());
    }

If your flow extends from another flow, or has states that extend other states, also override `getModelResources(FlowDefinitionResourceFactory)` to return the path to the parent flows.

    @Override
    protected FlowDefinitionResource[] getModelResources(FlowDefinitionResourceFactory resourceFactory) {
       return new FlowDefinitionResource[] {
           resourceFactory.createFileResource("src/main/webapp/WEB-INF/common/common.xml")
       };
    }

Prev | Up | Next
14.3. Specifying the path to the flow to test | Home | 14.5. Testing flow startup