Hi
SO I have several tests working with my web flow.
The first test I wrote, I had this section in my test (overriding AbstractXmlFlowExecutionTests, of course). I am using JMock but that is incidental.
So this covered what happened upon entry to the flow, I wanted one call to something that happens on-entry. It only happens once.Code:@Override protected void configureFlowBuilderContext(MockFlowBuilderContext builderContext) { final MyService myService = mockery.mock(MyService .class); mockery.checking(new Expectations() {{ exactly(1).of(myService).doStuff();will(returnValue(something)); }}); builderContext.registerBean("myService", myService ); }
All good so far. Now for the test on the next transition. I want to add some additional expectations within the the new test itself. So how can I get the mocked service in the new test ?
Or do I really have to assert all my expectations in the configureFlowBuilderContext method ? This is what I have done to date but it means that I tend to end up with more test case classes than I might otherwise have.
Cheers
Chris


Reply With Quote