}
@Test
public void testPersist() {
ActionManager actionManager = createStrictMock(ActionManager.class);
RequestFactory requestFactory = createStrictMock(RequestFactory.class);
Request request = createStrictMock(Request.class);
Stage stage1 = createNiceMock(Stage.class);
Stage stage2 = createNiceMock(Stage.class);
List<Stage> stages = new ArrayList<Stage>();
stages.add(stage1);
stages.add(stage2);
//expectations
expect(requestFactory.createNewFromStages(stages)).andReturn(request);
expect(request.getStages()).andReturn(stages).anyTimes();
actionManager.sendActions(request, null);
replay(actionManager, requestFactory, request, stage1, stage2);