Unit testing of nested substreams (substreams of substreams)

I am trying to write unit test for a thread that has a subflow that itself has another substream.

I am registering the first stream using FlowDefinitionResource getResource(FlowDefinitionResourceFactory resourceFactory) .

I then rewrite the definitions of the substream during the test execution in FlowDefinitionRegistry before moving on to them.

The transition to the first level subflow is normal. The result of the transition to the subflow of the current substream is NoSuchFlowDefinitionException .

The problem is that the sub-pound descriptions seem to be attached to the first test stream, and the sub-stream cannot be found in another sub-stream.

Is there a way to link the definition of a substream to another substream in tests that extend AbstractXmlFlowExecutionTests ?

+7
java spring-webflow spring-webflow-2 unit-testing junit
source share
2 answers

You must check each thread alone. So, test the top thread for the first time and make fun of the first substream, then check only the first substream and mock the second, etc ...

http://static.springsource.org/spring-webflow/docs/2.3.x/reference/html/ch15s07.html

+1
source share

I think it's possible, but a little confusing to get it right.

Take a look at this topic: Testing a thread using a subflow does not work . The answer to the bottom line is as follows: override the configureFlowBuilderContext virtual method (MockFlowBuilderContext builderContext) and register your layout.

This JIRA case for Spring framework addresses this issue and also offers its possible but confusing.

+1
source share

All Articles