### Question:
PipelineExecutionListener implements PipelineEventListener { @Override public void onStageError(OnErrorStageExecutionEvent oesee) { stageStatusChangeEvent.fire(new StageStatusChangeEvent(new PipelineExecutionTraceKey(oesee.getExecutionId()), oesee.getStage().getName(), PipelineStatus.ERROR)); } PipelineExecutionListener(); @Inject  PipelineExecutionListener(final Event<PipelineStatusChangeEvent> pipelineStatusChangeEvent,
                                     final Event<StageStatusChangeEvent> stageStatusChangeEvent); @Override void beforePipelineExecution(BeforePipelineExecutionEvent bpee); @Override void afterPipelineExecution(AfterPipelineExecutionEvent apee); @Override void beforeStageExecution(BeforeStageExecutionEvent bsee); @Override void onStageError(OnErrorStageExecutionEvent oesee); @Override void afterStageExecution(AfterStageExecutionEvent asee); @Override void onPipelineError(OnErrorPipelineExecutionEvent oepee);  }### Answer:
@Test public void testOnStageError() { listener.onStageError(new OnErrorStageExecutionEvent(EXECUTION_ID, pipeline, stage, throwable)); verify(stageStatusChangeEvent, times(1)).fire(new StageStatusChangeEvent(traceKey, STAGE_NAME, PipelineStatus.ERROR)); }