spring-boot-test-patterns

spring-boot-test-patterns is a skill for Claude Code from giuseppe-trisciuoglio/developer-kit. It costs 64 tokens per session (2,142 once invoked), scanned A, original, MIT.

A collection of testing patterns for Spring Boot applications, covering unit tests, focused tests for one application layer, full integration tests, and tests using temporary service containers. It uses JUnit 5, Mockito, MockMvc, and Testcontainers.

In plain words
What is it for?
Use it to test services with mocks, repositories, REST APIs, complete application setups, and integrations with temporary databases or message brokers.
Why use it?
It helps choose a suitable test type and test application code at the right level, from isolated business logic to real database or message-broker interactions.

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 services with mocks, repositories, REST APIs, complete application setups, and integrations with temporary databases or message brokers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/giuseppe-trisciuoglio/developer-kit/spring-boot-test-patterns
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 spring-boot-test-patterns
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 spring-boot-test-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/giuseppe-trisciuoglio/developer-kit/spring-boot-test-patterns/github.svg)](https://agentmods.dev/skills/giuseppe-trisciuoglio/developer-kit/spring-boot-test-patterns)
Your own site
<a href="https://agentmods.dev/skills/giuseppe-trisciuoglio/developer-kit/spring-boot-test-patterns"><img src="https://agentmods.dev/badge/skills/giuseppe-trisciuoglio/developer-kit/spring-boot-test-patterns/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 spring-boot-test-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/giuseppe-trisciuoglio/developer-kit/spring-boot-test-patterns"><img src="https://agentmods.dev/badge/skills/giuseppe-trisciuoglio/developer-kit/spring-boot-test-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,142 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 1 Apr 2026
  • Snyk pass 1 Apr 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.00064 $0.02142
Opus 5 $0.00032 $0.01071
Sonnet 5 $0.00013 $0.00428
Haiku 4.5 $0.00006 $0.00214

Measured yesterday against content hash fcab76f63cbf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

spring-boot-test-patterns 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 yesterday.

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/spring-boot-test-patterns/SKILL.md · 280 lines

How it starts

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

Spring Boot Testing Patterns

Overview

Comprehensive guidance for writing robust test suites for Spring Boot applications using JUnit 5, Mockito, Testcontainers, and performance-optimized slice testing patterns.

When to Use

  • Writing unit tests for services or repositories with mocked dependencies
  • Implementing integration tests with real databases via Testcontainers
  • Testing REST APIs with @WebMvcTest or MockMvc
  • Configuring @ServiceConnection for container management in Spring Boot 3.5+

Quick Reference

Test Type Annotation Target Time Use Case
Unit Tests @ExtendWith(MockitoExtension.class) < 50ms Business logic without Spring context
Repository Tests @DataJpaTest < 100ms Database operations with minimal context
Controller Tests @WebMvcTest / @WebFluxTest < 100ms REST API layer testing
Integration Tests @SpringBootTest < 500ms Full application context with containers
Testcontainers @ServiceConnection / @Testcontainers Varies Real database/message broker containers

Core Concepts

Test Architecture Philosophy

  1. Unit Tests — Fast, isolated tests without Spring context (< 50ms)
  2. Slice Tests — Minimal Spring context for specific layers (< 100ms)
  3. Integration Tests — Full Spring context with real dependencies (< 500ms)

Key Annotations

Spring Boot Test:

  • @SpringBootTest — Full application context (use sparingly)
  • @DataJpaTest — JPA components only (repositories, entities)
  • @WebMvcTest — MVC layer only (controllers, @ControllerAdvice)
  • @WebFluxTest — WebFlux layer only (reactive controllers)
  • @JsonTest — JSON serialization components only

Testcontainers:

  • @ServiceConnection — Wire Testcontainer to Spring Boot (3.5+)
  • @DynamicPropertySource — Register dynamic properties at runtime
  • @Testcontainers — Enable Testcontainers lifecycle management

Read the full file on GitHub · 280 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday First seen · 280 lines · 64 tokens per session scan A fcab76f63cbf

Subscribe to this mod's changes

spring-boot-test-patterns is a skill published in the GitHub repository giuseppe-trisciuoglio/developer-kit (344 stars, last pushed yesterday), licensed MIT. It adds 64 tokens to every session and 2,142 once invoked, about $0.0003 per session on Opus 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.

Related

Other skills, from other repositories

architecture-patterns

Architecture validation and patterns for clean architecture, backend structure enforcement, project structure validation, test standards, and context-aware sizing. Use when designing system boundaries, enforcing layered architecture, validating project structure, defining test standards, or choosing the right…

yonatangross/orchestkit · 56 tokens

rust-development

Idiomatisk Rust-utvikling med cargo, clippy, error handling, async/tokio, unsafe og testing.

navikt/copilot · 27 tokens

loom-test-strategy

Test strategy guidance covering pyramid design, coverage, test categorization, flaky tests, infrastructure, and risk-based prioritization.

cosmix/loom · 29 tokens

loom-testing

Test implementation across unit, integration, e2e, security, infrastructure, data pipeline, and ML domains.

cosmix/loom · 25 tokens

zunit

Generate and run zunit tests for java-cli-app projects. Use when asked to create tests, write tests, add tests, or generate test files for a java-cli-app project. Triggers on "zunit", "write tests", "create tests", "add tests", "test this", "generate tests", or requests to test a java-cli-app application. Also trigger…

AdamBien/airails · 111 tokens

continuous-testing

Continuous test-driven development loop — after every code change, builds the project, starts the server, and runs Unit Tests, Integration Tests, and System Tests. Applies on top of microprofile-server skill. Use during development when you want full verification after each change. Triggers on "continuous testing"…

AdamBien/airails · 84 tokens