Agent skill
Spring Boot Testing
Standards for unit, integration, and slice testing in Spring Boot 3
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/testing-hoangnguyen0403-agent-skills-standar-11
Metadata
Additional technical details for this skill
- labels
-
spring-boot testing junit testcontainers
- triggers
-
{ "files": [ "**/*Test.java" ], "keywords": [ "webmvctest", "datajpatest", "testcontainers", "assertj" ] }
SKILL.md
Spring Boot Testing Standards
Priority: P0
Implementation Guidelines
TDD Workflow
- Red: Write a failing test (e.g.,
returns 404). - Green: Implement minimal code to pass.
- Refactor: Clean up while keeping tests green.
- Coverage: Verify with JaCoCo.
Best Practices
- Real Infrastructure: Use Testcontainers for DB/Queues. See Integration Template.
- Slice Testing: See Slice Test Templates for
@WebMvcTest/@DataJpaTest.
Best Practices
- Real Infrastructure: Use Testcontainers for DB/Queues. Avoid H2/Embedded.
- Assertions: Use AssertJ (
assertThat) over JUnit assertions. - Isolation: Use
@MockBeanfor downstream dependencies in Slice Tests.
Anti-Patterns
- Context Reloading:
**No Dirty Contexts**: Avoid @MockBean in base classes. - External Calls:
**No network I/O**: Use WireMock. - System Out:
**No System.out**: Use assertions.
References
- Implementation Examples
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?