title: How to test spring ScheduledExecutorTask
body: <p>I have a test job which trows an exception. I would like to test that the exception is catched and after the correspondent period, the job is executed again. </p>
  
  <p>Following the <a href="https://src.springframework.org/svn/spring-maintenance/tags/release-2-0/tiger/test/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBeanTests.java" rel="nofollow">spring example</a>, I couldn´t figure it out. The imports are deprecated. How could I prove that fact using mockito?</p>
  
  <p>The job:</p>
  
  <pre><code>public class TestScheduler implements Runnable{
      @Override
      public void runScheduled(){
          LOGGER.info("Doing my tasks...");
          throw new RuntimeException("Testing purpose");
      }
  }
  </code></pre>
  
  <p>Config:</p>
  
  <pre><code>&lt;bean id="testScheduler" class="com.scheduler.TestScheduler"/&gt;
      &lt;bean id="testSchedulerTask" class="org.springframework.scheduling.concurrent.ScheduledExecutorTask"&gt;
          &lt;property name="delay" value="10"/&gt;
          &lt;property name="period" value="60"/&gt;
          &lt;property name="runnable" ref="testScheduler"/&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>Thanks in advance</p>