TokenCleanupTask extends TimerTask implements RepeatingTask { @Override public long getPeriod() { return 5 * 60 * 1000; } @Inject  TokenCleanupTask(final SessionFactory sessionFactory,
                            final DatabaseMigrationState dbState); @Override TimerTask getTask(); @Override long getPeriod(); @Override void run();  }
@Test public void getPeriod() { TokenCleanupTask task = new TokenCleanupTask(getSessionFactory(), null); assertEquals(5 * 60 * 1000, task.getPeriod()); }
@Test public void getDelay() { TokenCleanupTask task = new TokenCleanupTask(getSessionFactory(), null); assertEquals(task.getPeriod(), task.getDelay()); }