$npx skillfedfor your agent

springboot-tdd

Master test-driven development for Spring Boot services targeting 80%+ code coverage. This skill covers the complete TDD cycle—writing failing tests first, implementing minimal code to pass, refactoring safely, and enforcing coverage with JaCoCo. Learn unit testing with JUnit 5 and Mockito, web layer testing with MockMvc, integration testing with SpringBootTest, and persistence layer testing with DataJpaTest and Testcontainers.

springboot-tdd teaches test-driven development for Spring Boot using JUnit 5, Mockito, and MockMvc with 80%+ coverage targets.

AI-generated summary based on this skill's SKILL.md

1,767 298 MITupdated by xu-xiang

Decision gist · record as of 2026-03-05

springboot-tdd teaches test-driven development for Spring Boot using JUnit 5, Mockito, and MockMvc with 80%+ coverage targets. Master test-driven development for Spring Boot services targeting 80%+ code coverage. This skill covers the complete TDD cycle—writing failing tests first, implementing minimal code to pass, refactoring safely, and enforcing coverage with JaCoCo. Learn unit testing with JUnit 5 and Mockito, web layer testing with MockMvc, integration testing with SpringBootTest, and persistence layer testing with DataJpaTest and Testcontainers.

manual: git clone https://github.com/xu-xiang/everything-claude-code-zh → cp -r everything-claude-code-zh/skills/springboot-tdd ~/.claude/skills/springboot-tdd
skills/springboot-tdd/SKILL.md · version 6118ead7

Use it when

  • springboot-tdd covers the full TDD workflow for Spring Boot with JUnit 5 as its primary testing framework.
  • springboot-tdd teaches MockMvc for web layer testing and Mockito for mocking dependencies.

Verify before relying

Read SKILL.md below before installing (1 file). Open directory: indexed for reading, not audited.

Same gist for agents: .md · .json

Install

xu-xiang/everything-claude-code-zh/springboot-tdd · repository language: JavaScript

Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

What is the springboot-tdd skill's core focus?

springboot-tdd teaches test-driven development for Spring Boot services targeting 80%+ code coverage. It covers the complete TDD cycle—writing failing tests first, implementing minimal code to pass, refactoring safely, and enforcing coverage with JaCoCo. You'll learn unit testing with JUnit 5 and Mockito, web layer testing with MockMvc, integration testing with SpringBootTest, and persistence layer testing with DataJpaTest and Testcontainers.

How do I learn spring boot test driven development junit 5?

springboot-tdd covers the full TDD workflow for Spring Boot with JUnit 5 as its primary testing framework. You'll master writing failing tests first, implementing minimal code to pass them, and refactoring safely. The skill emphasizes best practices for TDD workflow and includes parameterized tests, custom assertions with AssertJ, and test isolation to ensure deterministic, repeatable test suites.

How can springboot-tdd help with mockito mock mvc testing?

springboot-tdd teaches MockMvc for web layer testing and Mockito for mocking dependencies. You'll learn to mock Spring beans, isolate controllers from services, and verify interactions. The skill covers both unit-level mocking and integration-level testing patterns, helping you write fast, focused tests that validate API behavior without requiring a full application context.

What does springboot-tdd cover for code coverage enforcement?

springboot-tdd includes setting up and enforcing code coverage targets using JaCoCo. You'll configure JaCoCo as a Maven or Gradle plugin, define coverage thresholds targeting 80%+, and integrate coverage checks into your CI/CD pipeline. The skill teaches how to measure coverage across unit, integration, and end-to-end tests to ensure meaningful coverage metrics.

Can springboot-tdd help me test repositories and services?

Yes, springboot-tdd covers unit testing for repositories using DataJpaTest and Testcontainers for real database instances. You'll learn to test service layers with mocked repositories, write integration tests that validate end-to-end flows, and use the data builder pattern for test fixture creation. The skill ensures your persistence and business logic layers are thoroughly tested.

How does springboot-tdd support refactoring existing code safely?

springboot-tdd teaches how to refactor Spring Boot code safely by establishing comprehensive test coverage first. With a solid test suite in place, you can confidently refactor implementation details while verifying behavior remains unchanged. The skill emphasizes test-driven refactoring as a best practice for maintaining code quality and preventing regressions during improvements.

SKILL.md

Rendered from the published skill. Quoted content, verbatim.

Spring Boot TDD 工作流

针对具有 80% 以上覆盖率(单元测试 + 集成测试)的 Spring Boot 服务的 TDD 指南。

适用场景

  • 新功能或 API 端点开发
  • Bug 修复或重构
  • 添加数据访问逻辑或安全规则

工作流

1) 先写测试(测试应当失败) 2) 实现通过测试的最简代码 3) 在测试通过的情况下重构代码 4) 强制执行覆盖率检查 (JaCoCo)

单元测试 (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());
  }
}

模式: - 准备-执行-断言 (Arrange-Act-Assert) - 避免部分 Mock;优先使用显式打桩 (Stubbing) - 使用 @ParameterizedTest 处理用例变体

Web 层测试 (MockMvc)

```java @WebMvcTest(MarketController.class) class MarketControllerTest { @Autowired MockMvc mockMvc; @MockBean MarketService marketService;

@Test void returnsMarkets() throws Exception {

(truncated - see the full file via the links below)

File tree — 1 file
skills/springboot-tdd/SKILL.md

Let your AI agent find skills like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.

wish › “Learn TDD workflow for Spring Boot with JUnit 5 and Mockito”

Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →

Related skills

spring-boot-test-patterns
by giuseppe-trisciuoglio · giuseppe-trisciuoglio/developer-kit

Spring Boot Test Patterns guides you through layered testing strategies—from fast unit tests with mocked dependencies to full integration tests with real databases via Testcontainers. Learn focused slice testing with @DataJpaTest and @WebMvcTest, REST API testing with MockMvc, and container setup using @ServiceConnection for Spring Boot 3.5+.

MITupdated Jun 2026
★ 311repo stars
Java Testing
by pluginagentmarketplace · pluginagentmarketplace/custom-plugin-java

Build reliable unit tests for Java applications using JUnit 5, Mockito, and AssertJ with support for mocking, parameterized tests, and fluent assertions. Includes integration testing patterns with Testcontainers and Spring Boot Test, plus TDD and test coverage best practices to improve code quality.

no license declared → metadata onlyupdated Jan 2026
★ 40repo stars
java-coding-standards
by affaan-m · affaan-m/ECC

Enforce consistent Java conventions across Spring Boot and Quarkus services with automatic framework detection. Covers naming, immutability, dependency injection, reactive patterns, exception handling, and project structure tailored to each framework's idioms.

MITupdated Jul 2026
★ 234,207repo stars
Spring Boot Idioms
by irahardianto · irahardianto/awesome-agv

Learn idiomatic Spring Boot 3.x patterns grounded in auto-configuration, constructor injection, and actuator-driven observability. Covers dependency injection best practices, Spring Data JPA query methods and projections, REST controller design with DTOs, and structured logging for production readiness. Includes testing patterns for integration and controller slices.

MITupdated Jul 2026
★ 150repo stars
unit-test-controller-layer
by giuseppe-trisciuoglio · giuseppe-trisciuoglio/developer-kit

Learn to unit test Spring REST controllers using MockMvc with mocked service dependencies. This skill covers testing HTTP methods, validating responses with JsonPath, handling errors, checking headers, and verifying content negotiation—all with focused examples for GET, POST, PUT, and DELETE endpoints.

MITupdated Jun 2026
★ 311repo stars
Java Test Generator
by dawiddutoit · dawiddutoit/custom-claude

Automatically generate well-structured JUnit 5 test cases for Java classes, complete with Mockito mocking, parameterized test scenarios, and edge case handling. The skill follows Arrange-Act-Assert patterns, creates tests for exception handling, verifies mock interactions, and targets high test coverage across service layers and Spring Boot components.

no license declared → metadata onlyupdated Jan 2026
★ 1repo stars

More skills springboot-patterns (MIT) · spring-boot-engineer (MIT) · springboot-security (MIT)

Tags
test-automationcode-coverage-metricsmock-testingcontainerized-testingassertion-frameworksci-cd-integrationtest-data-buildersbehavior-verification