Agent skill
backend-testing
Write and review backend tests with JUnit5, MockMvc, and Spring Boot Test. Use for writing controller tests, service tests, and integration tests.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/backend-testing
SKILL.md
Backend Testing Skill
When to Use
- Writing unit tests for services or repositories
- Writing controller tests with MockMvc
- Writing integration tests
- Reviewing test coverage or test quality
Stack
- JUnit5 + Spring Boot Test
- MockMvc for controller tests
- (Optional) Testcontainers for integration tests
Minimum Requirements
Each endpoint requires:
- At least 1 success test
- At least 1 failure test
Document important endpoints with Spring REST Docs.
What to Test
- Validation errors - Invalid input handling
- Authorization errors - If applicable
- Idempotency behaviors - Duplicate request handling
- TTL expiry behaviors - Session/token expiration
Test Organization
src/test/java/
├── controller/
│ └── {Feature}ControllerTest.java
├── service/
│ └── {Feature}ServiceTest.java
└── integration/
└── {Feature}IntegrationTest.java
Test Naming Convention
@Test
void should_ReturnSuccess_When_ValidInput() { }
@Test
void should_ThrowException_When_InvalidInput() { }
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?