Quality Assurance & Testing

Unit Test Scheduled Async

Provides patterns for unit testing Spring `@Scheduled` and `@Async` methods using JUnit 5, CompletableFuture, Awaitility, and Mockito. Covers mocking task execution and timing, verifying execution counts, testing cron expressions, validating retry behavior, and simulating thread pool behavior. Use when testing background tasks, cron jobs, periodic execution, scheduled tasks, or thread pool behavior.

Publisher / source
giuseppe-trisciuoglio/developer-kit (found on skills.sh)
Upstream record
giuseppe-trisciuoglio/developer-kit
Version
Version 1
Published
Publication review
Approved for publication · recorded passed scan 2026-11-01
Content fingerprint
912db37c2216971b2a81bc415bab41f9629f31bf4c0e896b3c20a11de3617070