I am working on a project using Spring Web Flow 2.0.
I am trying to unit test a flow that begins with a decision state. The decision state checks the value of an object that is on the conversationScope. I cannot figure out how to insert a value into the conversationScope for the unit test.
I have tried:
getConversationScope().put("someName", value);
MockExternalContext context = new MockExternalContext();
startFlow(context);
However, it seems that when I call startFlow(context) the value is cleared.
I also tried:
MockExternalContext context = new MockExternalContext();
setCurrentState("someDecisionState");
resumeFlow(context)
But the test fails with an error telling me that I cannot resume from a decision state, only from a view state.
Does anyone know how I can insert mock values on the conversationScope so that I may test these cases?