ListRolloverAction extends BaseRolloverAction { @Override public MetacardImpl doAction(MetacardImpl metacard, File tempFile) throws RolloverActionException { MetacardImpl tmp = metacard; for (RolloverAction rolloverAction : actionList) { tmp = rolloverAction.doAction(tmp, tempFile); } return tmp; } ListRolloverAction(List<RolloverAction> actionList); @Override MetacardImpl doAction(MetacardImpl metacard, File tempFile); @Override String toString();  }
@Test public void testDoAction() throws RolloverActionException { RolloverAction rolloverAction1 = mock(RolloverAction.class); RolloverAction rolloverAction2 = mock(RolloverAction.class); MetacardImpl metacard = mock(MetacardImpl.class); File tempFile = new File("a"); when(rolloverAction1.doAction(metacard, tempFile)).thenReturn(metacard); when(rolloverAction2.doAction(metacard, tempFile)).thenReturn(metacard); ListRolloverAction listRolloverAction = new ListRolloverAction(Arrays.asList(rolloverAction1, rolloverAction2)); MetacardImpl result = listRolloverAction.doAction(metacard, tempFile); assertThat(result, is(metacard)); verify(rolloverAction1).doAction(metacard, tempFile); verify(rolloverAction2).doAction(metacard, tempFile); }