This gives you patterns for unit testing Spring's @Scheduled and @Async methods without waiting for actual cron intervals or thread pool execution. It shows how to call scheduled methods directly (the annotations are ignored in unit tests anyway), use CompletableFuture.get() with timeouts, and leverage Awaitility for race conditions. The examples cover mocking dependencies with Mockito, testing exception propagation through ExecutionException, and verifying execution counts. The honest take: most developers test these wrong by either trying to invoke the Spring proxy or waiting for real scheduling, so having clear examples of calling methods directly and mocking the underlying logic saves a lot of confusion.
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill unit-test-scheduled-async