unit-test-application-events

unit-test-application-events is a skill for Claude Code from giuseppe-trisciuoglio/developer-kit. It costs 60 tokens per session (1,741 once invoked), scanned A, original, MIT.

Testing guidance for Spring application events, which are messages that parts of a Spring application publish and handle. It covers JUnit 5 and Mockito tests without starting the full application.

In plain words
What is it for?
Use it to test event publishers, methods marked with @EventListener, listener side effects, multiple listeners, and asynchronous event handling.
Why use it?
It helps check that events are published with the right data, handled by the right methods, and processed asynchronously without relying on a complete running application.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the developer-kit-java plugin — 52 skills, 11 commands, 9 agents shipped together

Good fit Use it to test event publishers, methods marked with @EventListener, listener side effects, multiple listeners, and asynchronous event handling.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/giuseppe-trisciuoglio/developer-kit/unit-test-application-events
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add giuseppe-trisciuoglio/developer-kit --skill unit-test-application-events
Clone the repo
git clone --depth 1 https://github.com/giuseppe-trisciuoglio/developer-kit

Made for: Claude Code.

Or install developer-kit-java, the plugin that ships this one along with the rest of its 52 skills, 11 commands, 9 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for unit-test-application-events

README.md
[![agentmods](https://agentmods.dev/badge/skills/giuseppe-trisciuoglio/developer-kit/unit-test-application-events/github.svg)](https://agentmods.dev/skills/giuseppe-trisciuoglio/developer-kit/unit-test-application-events)
Your own site
<a href="https://agentmods.dev/skills/giuseppe-trisciuoglio/developer-kit/unit-test-application-events"><img src="https://agentmods.dev/badge/skills/giuseppe-trisciuoglio/developer-kit/unit-test-application-events/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for unit-test-application-events

Your own site · 80×15
<a href="https://agentmods.dev/skills/giuseppe-trisciuoglio/developer-kit/unit-test-application-events"><img src="https://agentmods.dev/badge/skills/giuseppe-trisciuoglio/developer-kit/unit-test-application-events.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,741 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 14 Sept 2026
  • Snyk pass 14 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00060 $0.01741
Opus 5.5 $0.00024 $0.00696
Sonnet 5.5 $0.00012 $0.00348
Haiku 4.5 $0.00006 $0.00174

Measured 1mo ago against content hash aab533a352d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

unit-test-application-events scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/developer-kit-java/skills/unit-test-application-events/SKILL.md · 228 lines

How it starts

The opening of the file, as written. The whole thing — 228 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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 @EventListener method invocation and side effects
  • Testing event propagation through multiple listeners
  • Validating async event handling (@Async + @EventListener)
  • Mocking ApplicationEventPublisher in service tests

Instructions

  1. Add test dependencies: spring-boot-starter, JUnit 5, Mockito, AssertJ
  2. Mock ApplicationEventPublisher: use @Mock on the publisher field in the service under test
  3. Capture events with ArgumentCaptor: ArgumentCaptor.forClass(EventType.class) to inspect published payload
  4. Verify listener side effects: invoke listener directly against mocked dependencies
  5. Test async handlers: use Thread.sleep() or Awaitility — then assert the async operation was called
  6. Add validation checkpoints:
    • After capturing an event, confirm eventCaptor.getValue() is not null before asserting fields
    • If the listener is not invoked, verify publishEvent() was called with the correct event type
    • If async assertions fail, increase wait time and check the executor pool is not saturated
  7. Cover error scenarios: assert listeners handle exceptions gracefully

Examples

Maven

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
  <groupId>org.junit.jupiter</groupId>
  <artifactId>junit-jupiter</artifactId>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>org.mockito</groupId>
  <artifactId>mockito-core</artifactId>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>org.assertj</groupId>
  <artifactId>assertj-core</artifactId>
  <scope>test</scope>
</dependency>

Read the full file on GitHub · 228 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 228 lines · 60 tokens per session scan A aab533a352d0

Subscribe to this mod's changes

unit-test-application-events is a skill published in the GitHub repository giuseppe-trisciuoglio/developer-kit (360 stars, last pushed 1mo ago), licensed MIT. It adds 60 tokens to every session and 1,741 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-10.