unit-test-application-events
Installation
SKILL.md
Unit Testing Application Events
Overview
Provides actionable patterns for testing Spring ApplicationEvent publishers and @EventListener consumers using JUnit 5 and Mockito — without booting the full Spring context.
When to Use
- Writing unit tests for event publishers or listeners
- Verifying that an event was published with correct payload
- Testing
@EventListenermethod invocation and side effects - Testing event propagation through multiple listeners
- Validating async event handling (
@Async+@EventListener) - Mocking
ApplicationEventPublisherin service tests