ExecutionLogsCleaner { public void start() { logger.info("Starting execution logs clean up thread"); this.scheduler.scheduleAtFixedRate(() -> cleanExecutionLogs(), 0L, cleanupIntervalInSeconds, TimeUnit.SECONDS); } @Inject  ExecutionLogsCleaner(final Props azkProps, final ExecutorLoader executorLoader); void start();  }
@Test public void checkIfExecutionCleanerGetsTriggered() throws Exception { executionLogsCleaner.start(); TimeUnit.SECONDS.sleep(5); Mockito.verify(this.loader, atLeast(2)).removeExecutionLogsByTime(anyLong(), anyInt()); }