322-frameworks-spring-boot-testing-integration-tests — Claude Code
A skill for writing and reviewing Spring Boot 4.0.x integration tests: Testcontainers, persistence slices, HTTP assertions.
npx skills add jabrena/plinth --skill 322-frameworks-spring-boot-testing-integration-tests -a claude-codeWhat 322-frameworks-spring-boot-testing-integration-tests does
This skill sets the rules for Spring Boot 4.0.x integration tests. It draws the line between an integration test and a duplicated unit test: verify wiring and contracts, not isolated logic. Inside are guidelines for Testcontainers with @ServiceConnection for wiring without manual config, @DynamicPropertySource as a fallback for containers without built-in service connection support, and static @Container instances shared across test methods.
For HTTP you get two routes: MockMvcTester with AssertJ assertions, or TestRestTemplate for the full stack. The @DataJdbcTest and @DataJpaTest slices load only the persistence layer, so they start faster. Mocks are registered with @MockitoBean — Spring Boot 4.0.x removed @MockBean, so the skill will trip on older code. Data isolation is stated flatly: each test owns its scenario, with no shared mutable state and no ordering assumptions.
Before touching anything, the skill wants the project to compile: ./mvnw compile or mvn compile. If compilation fails, it stops there. After changes it runs ./mvnw clean verify or mvn clean verify. When the request scope is ambiguous, it stops and asks a clarifying question instead of guessing.
What it helps with
- write
@SpringBootTesttests with Testcontainers without hand-wiring the connection - separate integration tests from unit tests by purpose
- speed up runs with
@DataJdbcTestand@DataJpaTestslices - remove test dependence on execution order and shared state
- migrate mocks from the removed
@MockBeanto@MockitoBean
Example prompts for the agent
- Review my Spring Boot integration tests and tell me where I'm duplicating unit tests
- Rewrite this test with Testcontainers and
@ServiceConnection - Set up data isolation between tests in this class
How to install 322-frameworks-spring-boot-testing-integration-tests
1Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 322-frameworks-spring-boot-testing-integration-tests -a claude-code2Manually: put the files in place
~/.claude/skills/322-frameworks-spring-boot-testing-integration-tests/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/322-frameworks-spring-boot-testing-integration-tests/
1Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 322-frameworks-spring-boot-testing-integration-tests -a codex2Manually: put the files in place
.agents/skills/322-frameworks-spring-boot-testing-integration-tests/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 322-frameworks-spring-boot-testing-integration-tests -a cursor2Manually: put the files in place
.cursor/skills/322-frameworks-spring-boot-testing-integration-tests/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install jabrena/plinth 322-frameworks-spring-boot-testing-integration-tests2Manually: put the files in place
.github/skills/322-frameworks-spring-boot-testing-integration-tests/SKILL.md1Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 322-frameworks-spring-boot-testing-integration-tests -a gemini-cli2Platform CLI
gemini skills install https://github.com/jabrena/plinth --path skills/322-frameworks-spring-boot-testing-integration-testsManually: put the files in place
.devin/skills/322-frameworks-spring-boot-testing-integration-tests/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 322-frameworks-spring-boot-testing-integration-tests -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about 322-frameworks-spring-boot-testing-integration-tests
How do I install 322-frameworks-spring-boot-testing-integration-tests in Claude?
Run npx skills add jabrena/plinth --skill 322-frameworks-spring-boot-testing-integration-tests -a claude-code. The skill lands in ~/.claude/skills/322-frameworks-spring-boot-testing-integration-tests/SKILL.md.
What does this skill do?
It provides rules and good/bad code examples for Spring Boot 4.0.x integration tests: Testcontainers, persistence slices, HTTP assertions, data isolation, and container lifecycle.
What is required before applying changes?
The skill requires compiling the project first with ./mvnw compile or mvn compile. If compilation fails, it stops and applies nothing.
Source text
SKILL.md · Apache-2.0
--- name: 322-frameworks-spring-boot-testing-integration-tests description: Use when you need to write or improve integration tests — including Testcontainers with @ServiceConnection, @DataJdbcTest persistence slices, TestRestTemplate or MockMvcTester for HTTP, data isolation, and container lifecycle management for Spring Boot 4.0.x. This should trigger for requests such as Review Java code for Spring Boot integration tests; Apply best practices for Spring Boot integration tests in Java code; Write @SpringBootTest integration tests with Testcontainers; Configure dynamic properties for Spring integration tests; Review Spring Boot integration test profiles. Part of Plinth Toolkit license: Apache-2.0 metadata: author: Juan Antonio Breña Moral version: 0.19.0 --- # Spring Boot Integration Testing Apply Spring Boot integration testing guidelines for Spring Boot 4.0.x. **What is covered in this Skill?** - Integration test scope and purpose (verify wiring and contracts, not unit-test duplication) - Testcontainers with @ServiceConnection for zero-config wiring (preferred) - @DynamicPropertySource as fallback for containers without built-in service connection support - Static @Container instances shared across test methods for performance - MockMvcTester for fluent AssertJ-based HTTP assertions (Spring Boot 4.0.x) - TestRestTemplate for full HTTP stack testing - @DataJdbcTest / @DataJpaTest persistence slices (load only persistence layer, start faster) - Data isolation: each test owns its scenario; no shared mutable state or ordering assumptions - @MockitoBean for mock registration (Spring Boot 4.0.x — @MockBean removed) - Resource lifecycle: Testcontainers JUnit integration for teardown; *IT / integration test separation **Scope:** Apply recommendations based on the reference rules and good/bad code examples. ## Constraints Before applying any integration test changes, ensure the project compiles. If compilation fails, stop immediately. After applying improvements, run full verification. - **MANDATORY**: Run `./mvnw compile` or `mvn compile` before applying any change - **SAFETY**: If compilation fails, stop immediately - **VERIFY**: Run `./mvnw clean verify` or `mvn clean verify` after applying improvements - **BEFORE APPLYING**: Read the reference for detailed rules and good/bad patterns - **EDGE CASE**: If request scope is ambiguous, stop and ask a clarifying question before applying changes - **EDGE CASE**: If required inputs, files, or tooling are missing, report what is missing and ask whether to proceed with setup guidance ## When to use this skill - Review Java code for Spring Boot integration tests - Apply best practices for Spring Boot integration tests in Java code - Write @SpringBootTest integration tests with Testcontainers - Configure dynamic properties for Spring integration tests - Review Spring Boot integration test profiles ## Workflow 1. **Read reference and assess project context** Read `references/322-frameworks-spring-boot-testing-integration-tests.md` and inspect the current project setup before proposing changes. 2. **Gather scope and decide target improvements** Identify requested outcomes, constraints, and the minimum safe set of changes to apply. 3. **Apply framework-aligned changes** Implement or refactor configuration/code following the reference patterns and project conventions. 4. **Run verification and report results** Execute appropriate build/tests and summarize what changed, what was verified, and any follow-up actions. ## Reference For detailed guidance, examples, and constraints, see [references/322-frameworks-spring-boot-testing-integration-tests.md](references/322-frameworks-spring-boot-testing-integration-tests.md).
© Juan Antonio Breña Moral · Apache-2.0 · jabrena/plinth