OnceSchedulingStrategy implements ISchedulingStrategy { @Override public void postProcess(final ISchedulerEntry entry) throws SchedulingStrategyExecutionException { try { entry.cancel(); } catch (EntryStorageAccessException | EntryScheduleException e) { throw new SchedulingStrategyExecutionException("Error occurred cancelling completed entry.", e); } } OnceSchedulingStrategy(); @Override void init(final ISchedulerEntry entry, final IObject args); @Override void postProcess(final ISchedulerEntry entry); @Override void restore(final ISchedulerEntry entry); @Override void processException(final ISchedulerEntry entry, final Throwable e); @Override void notifyPaused(final ISchedulerEntry entry); @Override void notifyUnPaused(final ISchedulerEntry entry); @Override void processPausedExecution(final ISchedulerEntry entry);  }
@Test public void Should_cancelEntryWhenItIsDone() throws Exception { ISchedulingStrategy strategy = new OnceSchedulingStrategy(); strategy.postProcess(entry); verify(entry).cancel(); }