affaan-m avatar

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-tdd
On this page
  1. What springboot-tdd covers
  2. springboot-tdd by the numbers
  3. What does the Springboot Tdd skill produce?
  4. What files ship with springboot-tdd?
  5. Which skills are related to springboot-tdd?
  6. What are the Springboot Tdd skill forks?
  7. How does springboot-tdd compare?
  8. Springboot Tdd skill FAQ
  9. More in this repo

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 installs13,785 (13.8k)skills.sh registry
Repo stars★ 315kGitHub
Repo last updatedDecember 1, 2026GitHub
Repositoryaffaan-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?

SKILL.mdMarkdownGitHub ↗

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 @ParameterizedTest para 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 @DynamicPropertySource para 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 test o mvn 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.

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.

Listed on Skillselion
Get the embed code
Testing & QAbackendtesting

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.