MapComponent implements ComponentExecutor { @Override public boolean execute(DataUnitManager dataUnitManager) { execution.onMapComponentBegin(execComponent); try { dataUnitManager.onComponentMapByReference(execComponent); } catch (ExecutorException ex) { execution.onMapComponentFailed(execComponent, ex); return false; } execution.onMapComponentSuccessful(execComponent); return true; } MapComponent(ExecutionObserver execution,
            ExecutionComponent execComponent); @Override boolean execute(DataUnitManager dataUnitManager);  }
@Test public void execute() throws ExecutorException { ExecutionObserver execution = Mockito.mock(ExecutionObserver.class); ExecutionComponent execComponent = Mockito.mock(ExecutionComponent.class); MapComponent executor = new MapComponent(execution, execComponent); DataUnitManager dataUnits = Mockito.mock(DataUnitManager.class); executor.execute(dataUnits); Mockito.verify(dataUnits, Mockito.times(1)) .onComponentMapByReference(execComponent); Mockito.verify(execution, Mockito.times(1)) .onMapComponentBegin(execComponent); Mockito.verify(execution, Mockito.times(1)) .onMapComponentSuccessful(execComponent); }