CheckerForTargetsConfigurationTask extends TimerTask { @Override public void run() { this.logger.finest( "The task that checks for targets configuration runs." ); this.targetConfigurator.verifyCandidates(); } CheckerForTargetsConfigurationTask( ITargetConfigurator targetConfigurator ); @Override void run();  }
@Test public void testApiIsInvoked() { ITargetConfigurator targetConfigurator = Mockito.mock( ITargetConfigurator.class ); CheckerForTargetsConfigurationTask task = new CheckerForTargetsConfigurationTask( targetConfigurator ); task.run(); Mockito.verify( targetConfigurator, Mockito.only()).verifyCandidates(); }