This one walks you through unit testing Spring application events without spinning up the whole context. You'll mock ApplicationEventPublisher, capture events with ArgumentCaptor to inspect payloads, and test listeners in isolation against mocked dependencies. It covers the async handler case too, complete with the Thread.sleep versus Awaitility tradeoff. The validation checkpoints are practical: confirm your captor actually caught something before asserting on fields, verify the right event type was published if listeners don't fire. Honestly, the error handling examples alone make this worth using. Most teams skip testing that listeners swallow exceptions gracefully, then wonder why one bad listener tanks the whole event chain in production.
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill unit-test-application-events