JobTriggerListener extends TriggerListenerSupport { @Override public void triggerMisfired(final Trigger trigger) { if (null != trigger.getPreviousFireTime()) { executionService.setMisfire(shardingService.getLocalShardingItems()); } }  @Override String getName(); @Override void triggerMisfired(final Trigger trigger);  }
@Test public void assertTriggerMisfiredWhenPreviousFireTimeIsNull() { jobTriggerListener.triggerMisfired(trigger); verify(executionService, times(0)).setMisfire(Collections.singletonList(0)); }
@Test public void assertTriggerMisfiredWhenPreviousFireTimeIsNotNull() { when(shardingService.getLocalShardingItems()).thenReturn(Collections.singletonList(0)); when(trigger.getPreviousFireTime()).thenReturn(new Date()); jobTriggerListener.triggerMisfired(trigger); verify(executionService).setMisfire(Collections.singletonList(0)); }