### Question:
ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void jobExecutionFailure(FlowableEngineEntityEvent event) { if (event instanceof FlowableExceptionEvent) { handleWithCorrelationId(event, () -> handle(event, (FlowableExceptionEvent) event)); } } @Inject  ErrorProcessListener(OperationInErrorStateHandler eventHandler); @Override boolean isFailOnException();  }### Answer:
@Test void testJobExecutionFailureWithWrongEventClass() { FlowableEngineEntityEvent engineEntityEvent = Mockito.mock(FlowableEngineEntityEvent.class); errorProcessListener.jobExecutionFailure(engineEntityEvent); Mockito.verifyNoInteractions(eventHandler); }
@Test void testJobExecutionFailureWithNoException() { FlowableEngineEntityEvent engineEntityEvent = Mockito.mock(FlowableEngineEntityEvent.class, Mockito.withSettings() .extraInterfaces(FlowableExceptionEvent.class)); errorProcessListener.jobExecutionFailure(engineEntityEvent); Mockito.verifyNoInteractions(eventHandler); }
@Test void testJobExecutionFailure() { FlowableEngineEntityEvent engineEntityEvent = Mockito.mock(FlowableEngineEntityEvent.class, Mockito.withSettings() .extraInterfaces(FlowableExceptionEvent.class)); FlowableExceptionEvent exceptionEvent = (FlowableExceptionEvent) engineEntityEvent; Throwable t = new Throwable(); Mockito.when(exceptionEvent.getCause()) .thenReturn(t); errorProcessListener.jobExecutionFailure(engineEntityEvent); Mockito.verify(eventHandler) .handle(engineEntityEvent, t); }