Springboot TDD Skill
- Installs
- 13.8k
- Repo stars
- 315k
- Repo updated
- Dec 1, 2026
TL;DR
springboot-tdd is a Claude Code skill that enforces test-driven development on Spring Boot services using JUnit 5, Mockito, MockMvc, Testcontainers, and JaCoCo for developers adding features or fixing bugs.
Install if
Java developers building or refactoring Spring Boot APIs who want strict red-green-refactor TDD with Mockito, MockMvc, and Testcontainers.
Skip if
Frontend-only projects, non-JVM stacks, or teams that do not enforce coverage gates with JaCoCo on Spring Boot services.
npx skills add https://github.com/affaan-m/ECC --skill springboot-tddTry it first through the Skillselion MCP - nothing to install, nothing on disk.
1. Add the remote connector:
claude mcp add --transport http skillselion https://mcp.skillselion.com/mcp2. Ask your agent:
Use Skillselion load_skill to load skill:affaan-m/ecc#springboot-tdd (Springboot Tdd) and follow it.Try it first through the Skillselion MCP - nothing to install, nothing on disk.
1. Add this URL as a custom connector (Claude.ai, ChatGPT or Cursor):
https://mcp.skillselion.com/mcp2. Ask your agent:
Use Skillselion load_skill to load skill:affaan-m/ecc#springboot-tdd (Springboot Tdd) and follow it.On this page
What springboot-tdd covers
- 80%+ combined unit and integration test coverage enforced by JaCoCo
- 4-step red-green-refactor workflow that guarantees tests fail first
- JUnit 5 + Mockito + MockMvc + Testcontainers patterns included
- Arrange-Act-Assert and @ParameterizedTest usage rules
- Guidance for new features, bug fixes, data access, and security rules
springboot-tdd by the numbers
| All-time installs | 13,785 (13.8k) | skills.sh registry |
|---|---|---|
| Repo stars | ★ 315k | GitHub |
| Repo last updated | December 1, 2026 | GitHub |
| Repository | affaan-m/ECC ↗ | |
Data as of Dec 2, 2026 (Skillselion catalog sync)
- Targets 80%+ unit and integration coverage enforced with JaCoCo
- Stacks JUnit 5, Mockito, MockMvc, and Testcontainers for Spring Boot TDD
What does the Springboot Tdd skill produce?
Spring Boot implementations with JUnit 5 unit tests, MockMvc web tests, Testcontainers integration tests, and JaCoCo coverage reports at 80%+.
- JUnit 5 test suites
- MockMvc and Testcontainers integration tests
- JaCoCo coverage reports
What files ship with springboot-tdd?
Flujo de Trabajo TDD en Spring Boot
Orientación TDD para servicios Spring Boot con 80%+ de cobertura (unit + integración).
Cuándo Usar
- Nuevas funcionalidades o endpoints
- Correcciones de bugs o refactorizaciones
- Agregar lógica de acceso a datos o reglas de seguridad
Flujo de Trabajo
1) Escribir pruebas primero (deben fallar) 2) Implementar el código mínimo para que pasen 3) Refactorizar con pruebas en verde 4) Exigir cobertura con JaCoCo
Pruebas Unitarias (JUnit 5 + Mockito)
@ExtendWith(MockitoExtension.class)
class MarketServiceTest {
@Mock MarketRepository repo;
@InjectMocks MarketService service;
@Test
void createsMarket() {
CreateMarketRequest req = new CreateMarketRequest("name", "desc", Instant.now(), List.of("cat"));
when(repo.save(any())).thenAnswer(inv -> inv.getArgument(0));
Market result = service.create(req);
assertThat(result.name()).isEqualTo("name");
verify(repo).save(any());
}
}Patrones:
- Arrange-Act-Assert
- Evitar mocks parciales; preferir stubbing explícito
- Usar
@ParameterizedTestpara variantes
Pruebas de Capa Web (MockMvc)
@WebMvcTest(MarketController.class)
class MarketControllerTest {
@Autowired MockMvc mockMvc;
@MockBean MarketService marketService;
@Test
void returnsMarkets() throws Exception {
when(marketService.list(any())).thenReturn(Page.empty());
mockMvc.perform(get("/api/markets"))
.andExpect(status().isOk())
.andExpect(jsonPath("$.content").isArray());
}
}Pruebas de Integración (SpringBootTest)
@SpringBootTest
@AutoConfigureMockMvc
@ActiveProfiles("test")
class MarketIntegrationTest {
@Autowired MockMvc mockMvc;
@Test
void createsMarket() throws Exception {
mockMvc.perform(post("/api/markets")
.contentType(MediaType.APPLICATION_JSON)
.content("""
{"name":"Test","description":"Desc","endDate":"2030-01-01T00:00:00Z","categories":["general"]}
"""))
.andExpect(status().isCreated());
}
}Pruebas de Persistencia (DataJpaTest)
@DataJpaTest
@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
@Import(TestContainersConfig.class)
class MarketRepositoryTest {
@Autowired MarketRepository repo;
@Test
void savesAndFinds() {
MarketEntity entity = new MarketEntity();
entity.setName("Test");
repo.save(entity);
Optional<MarketEntity> found = repo.findByName("Test");
assertThat(found).isPresent();
}
}Testcontainers
- Usar contenedores reutilizables para Postgres/Redis que reflejen producción
- Conectar mediante
@DynamicPropertySourcepara inyectar URLs JDBC en el contexto de Spring
Cobertura (JaCoCo)
Fragmento Maven:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.14</version>
<executions>
<execution>
<goals><goal>prepare-agent</goal></goals>
</execution>
<execution>
<id>report</id>
<phase>verify</phase>
<goals><goal>report</goal></goals>
</execution>
</executions>
</plugin>Aserciones
- Preferir AssertJ (
assertThat) para legibilidad - Para respuestas JSON, usar
jsonPath - Para excepciones:
assertThatThrownBy(...)
Builders de Datos de Prueba
class MarketBuilder {
private String name = "Test";
MarketBuilder withName(String name) { this.name = name; return this; }
Market build() { return new Market(null, name, MarketStatus.ACTIVE); }
}Comandos de CI
- Maven:
mvn -T 4 testomvn verify - Gradle:
./gradlew test jacocoTestReport
Recuerda: Mantener las pruebas rápidas, aisladas y deterministas. Probar comportamiento, no detalles de implementación.
Which skills are related to springboot-tdd?
What are the Springboot Tdd skill forks?
Springboot Tdd has 1 known copy in the catalog totaling 6.7k installs. They canonicalize to this original listing.
- affaan-m - 6.7k installs
How does springboot-tdd compare?
Use springboot-tdd for Java Spring Boot red-green-refactor; use generic testing skills for non-JVM frameworks or test-after workflows.
Springboot Tdd skill FAQ
Who is the Springboot Tdd skill for?
Java developers building or refactoring Spring Boot APIs who want strict red-green-refactor TDD with Mockito, MockMvc, and Testcontainers. Skip if: Frontend-only projects, non-JVM stacks, or teams that do not enforce coverage gates with JaCoCo on Spring Boot services.
When should I use springboot-tdd?
The user adds Spring Boot features, fixes backend bugs, refactors services, or asks for TDD with JUnit 5, MockMvc, or Testcontainers.
Which testing libraries does springboot-tdd use?
springboot-tdd uses JUnit 5, Mockito, MockMvc, and Testcontainers for Spring Boot unit, web, and integration tests, with JaCoCo enforcing coverage targets after each TDD cycle.
What coverage target does springboot-tdd require?
springboot-tdd targets 80%+ combined unit and integration coverage on Spring Boot services, verified through JaCoCo as part of the red-green-refactor workflow.
When should developers invoke springboot-tdd?
springboot-tdd fits new Spring Boot endpoints, bug fixes, refactors, and data-access or security changes where tests must be written before implementation.
Add a springboot-tdd badge
Show developers this skill is listed on Skillselion. Paste this into your README.