Agent skill · software engineering · affaan-m

springboot-tdd

Test-driven development for Spring Boot using JUnit 5, Mockito, MockMvc, Testcontainers, and JaCoCo. Use when adding features, fixing bugs, or refactoring.

Why this skill is useful

Provides specific TDD patterns and executable test examples for Spring Boot that the AI wouldn't reliably generate on its own.

What it needs

Requires gradle, maven, testcontainers installed locally. About 1k tokens when loaded. Last updated 2026-08-06. 238,342 stars on the source repository.

What this skill does

Spring Boot TDD Workflow TDD guidance for Spring Boot services with 80%+ coverage (unit + integration). When to Use New features or endpoints Bug fixes or refactors Adding data access logic or security rules Workflow 1) Write tests first (they should fail) 2) Implement minimal code to pass 3) Refactor with tests green 4) Enforce coverage (JaCoCo) Unit Tests (JUnit 5 + Mockito) Patterns: Arrange-Act-Assert Avoid partial mocks; prefer explicit stubbing Use @ParameterizedTest for variants Web Layer Tests (MockMvc) Integration Tests (SpringBootTest) Persistence Tests (DataJpaTest) Testcontainers Use reusable containers for Postgres/Redis to mirror production Wire via @DynamicPropertySource to inject JDBC URLs into Spring context Coverage (JaCoCo) Maven snippet: Assertions Prefer AssertJ (assertThat) for readability For JSON responses, use jsonPath For exceptions: assertThatThrownBy(...) Test Data Builders CI Commands Maven: mvn -T 4 test or mvn verify Gradle: ./gradlew test jacocoTestReport Remember: Keep tests fast, isolated, and deterministic. Test behavior, not implementation details.

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills affaan-m/springboot-tdd--2f2b41

View the source on GitHub

Browse the @skills marketplace