I was searching a long time for options to test @Scheduled annotated methods in Spring Boot Java application. There are several ways to trigger such a job (e.g. fixedRate, cron etc.).
Is there a general approach to test such methods? In my project I need to schedule multiple processes (mostly using cron attribute of @Scheduled) and I need to have an overview about all of them.
My assumption was that some feature to inject custom System.currentTimeMillis()
implementation that speeds up the time counter (let's say parametrized - 1x to 1000000x faster), so all depending Dates, Calendars and Timers will be immediately affected.
I have found nothing.