backend-spring-test

backend-spring-test is a skill for Claude Code from infraspecdev/tesseract. It costs 75 tokens per session (1,363 once invoked), scanned A, original, MIT.

A review guide for Spring Boot tests, including tests for web controllers, database access, and the full application setup.

In plain words
What is it for?
It is for checking test-slice choices, mock usage, Testcontainers versus H2, application-context cleanup, and security setup in tests.
Why use it?
It helps prevent tests that start too much, rely on excessive mocking, leave shared state behind, or use unsuitable test databases.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the shield plugin — 36 skills, 17 commands, 22 agents shipped together

Good fit It is for checking test-slice choices, mock usage, Testcontainers versus H2, application-context cleanup, and security setup in tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/infraspecdev/tesseract/spring-test
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 infraspecdev/tesseract --skill spring-test
Clone the repo
git clone --depth 1 https://github.com/infraspecdev/tesseract

Made for: Claude Code.

Or install shield, the plugin that ships this one along with the rest of its 36 skills, 17 commands, 22 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 backend-spring-test

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/infraspecdev/tesseract/spring-test"><img src="https://agentmods.dev/badge/skills/infraspecdev/tesseract/spring-test.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,363 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.
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.00075 $0.01363
Opus 5.5 $0.00030 $0.00545
Sonnet 5.5 $0.00015 $0.00273
Haiku 4.5 $0.00007 $0.00136

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

Security

Grade A, and why

backend-spring-test 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.

shield/skills/backend/spring-test/SKILL.md · 91 lines

How it starts

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

Spring Test Review

Overview

Review Spring Boot tests for appropriate slice scope, mock placement, and context isolation. Pairs with the agnostic testing-strategy-review (which covers test pyramid, mocking SUT, flaky patterns).

Triggers when spring-boot-starter-test is detected and test source files are in scope. The agnostic skill flags WHAT is wrong with a test; this skill flags HOW Spring's test annotations should be used.

Version Compatibility

Supported: Spring Boot 3.x (declared via spring_boot_versions: ["3.x"] in frontmatter).

Spring Boot 2.x — degraded coverage:

  • All checks (ST1–ST10) apply identically across SB2/SB3
  • Package paths differ slightly (jakarta.servlet.* in SB3 vs javax.servlet.* in SB2 for MockMvc/WebMvcTest internals)

Spring Boot 3.4+: @MockBean was deprecated in Spring Framework 6.2 in favor of @MockitoBean / @MockitoSpyBean. ST2/ST3 examples in this skill use @MockBean; on SB3.4+ codebases prefer @MockitoBean. The semantic checks (mock necessity, slice scope) are unchanged.

To extend coverage for SB2 or SB3.4+, follow Pattern A (broaden the rubric) per shield/skills/backend/EXTENDING-VERSIONS.md.

When to Use

  • Reviewing @SpringBootTest, @WebMvcTest, @DataJpaTest, etc.
  • Reviewing @MockBean and @SpyBean usage
  • Reviewing Testcontainers vs H2 in-memory choices
  • Reviewing test security context (@WithMockUser, etc.)

When NOT to Use

  • Pure JUnit assertion patterns — use testing-strategy-review
  • Non-Spring test frameworks (pytest, jest) — different conventions
  • Performance test design — separate skill not in v1

Review Process

  1. Inventory: test classes by their primary slice annotation
  2. For each, apply Evaluation Points ST1–ST10
  3. Cross-cut: confirm @SpringBootTest is reserved for full integration, not unit tests in disguise

Evaluation Points

# Check What to Look For Severity
ST1 Test slice selection Use @WebMvcTest for controllers, @DataJpaTest for repos, @JsonTest for serialization, @SpringBootTest only when truly integration-shaped High
ST2 @MockBean necessity Mock collaborators that aren't part of the slice. Don't mock everything — slice annotations auto-configure the layer Medium
ST3 @SpringBootTest scope Full context boot is slow. Justify when a smaller slice would work High
ST4 @DirtiesContext minimization Recreating the context per test is very slow. Use only when absolutely required (rare); prefer test-data isolation via transactions or @Sql High
ST5 Testcontainers vs H2 Testcontainers gives a real database (catches dialect issues). H2 is faster but masks production differences. Choose deliberately Medium
ST6 Test security context @WithMockUser, @WithUserDetails, or custom security context. Don't disable security in tests Medium
ST7 @Transactional in tests Tests marked @Transactional roll back automatically — good for isolation. Avoid in tests that span multiple transactions Medium
ST8 MockMvc vs WebTestClient MockMvc for MVC; WebTestClient for WebFlux. Don't mix layers Low
ST9 Parallel test safety If tests run in parallel, no shared mutable state across classes. @Execution(SAME_THREAD) for legacy tests Medium
ST10 Test data setup @Sql for repo tests, TestEntityManager.persist in @DataJpaTest. Don't rely on schema state from prior tests Medium

Read the full file on GitHub · 91 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 · 91 lines · 75 tokens per session scan A 0430e6164a51

Subscribe to this mod's changes

backend-spring-test is a skill published in the GitHub repository infraspecdev/tesseract (5 stars, last pushed 3mo ago), licensed MIT. It adds 75 tokens to every session and 1,363 once invoked, about $0.0003 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-03.

Related

Other skills, from other repositories

server-side-calls

Call tRPC procedures directly from server code using t.createCallerFactory() and router.createCaller(context) for integration testing, internal server logic, and custom API endpoints. Catch TRPCError and extract HTTP status with getHTTPStatusCodeFromError(). Error handling via onError option.

trpc/trpc · 61 tokens

mem0-test-integration

Verify a Mem0 integration produced by /mem0-integrate. Runs in the same workspace on the same branch (loose coupling) — installs dependencies, runs the repo's native test suite, then exercises a real end-to-end smoke flow against the user's API key. Produces a scorecard. TRIGGER when: user has just run /mem0-integrate…

mem0ai/mem0 · 207 tokens

prowler-test-api

Testing patterns for Prowler API: JSON:API, Celery tasks, RLS isolation, RBAC. Trigger: When writing tests for api/ (JSON:API requests/assertions, cross-tenant isolation, RBAC, Celery tasks, viewsets/serializers).

prowler-cloud/prowler · 62 tokens

python-sdk

Implement or modify Python SDK behavior under python/composio, including tools, toolkits, sessions, auth configs, connected accounts, client integration, and shared Python models. Use for Python core runtime/API work; pair with python-testing and cross-sdk-parity when TypeScript must match.

ComposioHQ/composio · 60 tokens

convex-test

Generate convex-test tests for the app's Convex functions.

openclaw/clawhub · 16 tokens

voiden

Create and edit Voiden .void files for API testing. Covers the .void file format and all enabled extension block types.

VoidenHQ/voiden · 28 tokens