@Test public void testOnFailedWhenNoMessages() throws InterruptedException { List<ExecutionMessage> messages = new ArrayList<>(); queueListener.onFailed(messages); verify(eventBus, never()).dispatch(); }
@Override public void onFailed(List<ExecutionMessage> messages) { deleteExecutionStateObjects(messages); ScoreEvent[] events = createFailureEvents(messages); if (events.length > 0) { try { eventBus.dispatch(events); } catch (InterruptedException e) { logger.error("Thread is interrupted. Ignoring... ", e); } } }
QueueListenerImpl implements QueueListener { @Override public void onFailed(List<ExecutionMessage> messages) { deleteExecutionStateObjects(messages); ScoreEvent[] events = createFailureEvents(messages); if (events.length > 0) { try { eventBus.dispatch(events); } catch (InterruptedException e) { logger.error("Thread is interrupted. Ignoring... ", e); } } } }
QueueListenerImpl implements QueueListener { @Override public void onFailed(List<ExecutionMessage> messages) { deleteExecutionStateObjects(messages); ScoreEvent[] events = createFailureEvents(messages); if (events.length > 0) { try { eventBus.dispatch(events); } catch (InterruptedException e) { logger.error("Thread is interrupted. Ignoring... ", e); } } }  }
QueueListenerImpl implements QueueListener { @Override public void onFailed(List<ExecutionMessage> messages) { deleteExecutionStateObjects(messages); ScoreEvent[] events = createFailureEvents(messages); if (events.length > 0) { try { eventBus.dispatch(events); } catch (InterruptedException e) { logger.error("Thread is interrupted. Ignoring... ", e); } } }  @Override void prePersist(List<ExecutionMessage> messages); @Override void onEnqueue(List<ExecutionMessage> messages, int queueSize); @Override void onPoll(List<ExecutionMessage> messages, int queueSize); @Override void onTerminated(List<ExecutionMessage> messages); @Override void onFailed(List<ExecutionMessage> messages); @Override void onPersistMessage(List<ExecutionMessage> messages); }
QueueListenerImpl implements QueueListener { @Override public void onFailed(List<ExecutionMessage> messages) { deleteExecutionStateObjects(messages); ScoreEvent[] events = createFailureEvents(messages); if (events.length > 0) { try { eventBus.dispatch(events); } catch (InterruptedException e) { logger.error("Thread is interrupted. Ignoring... ", e); } } }  @Override void prePersist(List<ExecutionMessage> messages); @Override void onEnqueue(List<ExecutionMessage> messages, int queueSize); @Override void onPoll(List<ExecutionMessage> messages, int queueSize); @Override void onTerminated(List<ExecutionMessage> messages); @Override void onFailed(List<ExecutionMessage> messages); @Override void onPersistMessage(List<ExecutionMessage> messages);  }