@Test
public void testGetActions() throws Exception {

  int requestId = 500;
  ActionQueue queue = createNiceMock(ActionQueue.class);
  ActionDBAccessor db = createStrictMock(ActionDBAccessor.class);
  Clusters clusters = createNiceMock(Clusters.class);
  Stage stage1 = createNiceMock(Stage.class);
  Stage stage2 = createNiceMock(Stage.class);
  List<Stage> listStages = new ArrayList<Stage>();
  listStages.add(stage1);
  listStages.add(stage2);
  // mock expectations
  expect(db.getLastPersistedRequestIdWhenInitialized()).andReturn(Long.valueOf(1000));
  expect(db.getAllStages(requestId)).andReturn(listStages);
  replay(queue, db, clusters);
  ActionScheduler actionScheduler = new ActionScheduler(0, 0, db, createNiceMock(JPAEventPublisher.class));
  ActionManager manager = new ActionManager(db, injector.getInstance(RequestFactory.class), actionScheduler);
  assertSame(listStages, manager.getActions(requestId));
  verify(queue, db, clusters);
}