Announcement Announcement Module
No announcement yet.
Testing Spring Webflow Action Classes Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Testing Spring Webflow Action Classes

    I am writing test case for my webflow using org.springframework.webflow.test.execution.Abstrac tXmlFlowExecutionTests

    public class MyFlowExecutionTests extends AbstractXmlFlowExecutionTests { }

    In some cases my logic is simple, So I invoke my service layer directly from the Spring webflow. In some cases I use an extenstion of org.springframework.webflow.action.MultiAction classes and I invoke my service layer from the action classes.

    In the first scenario, wrting test case is straight forward. In the second scenario, I found it really complex to write the test cases using org.springframework.webflow.test.execution.Abstrac tXmlFlowExecutionTests for the Action class. In the first scenario, I can mock all the service classes used from my flow. In the second scenario, using easy mock class extension, I can mock the action class. But then I need to mock the service layers used inside, which I think mock can't handle that well.

    I am now thinking of somehow moving the Action class code to Spring EL. Or Anybody have a better idea for testing the action class code along with webflow code?..