spring-testing

Guide Spring Boot unit, slice, and integration tests with JUnit 5 and Mockito.

1|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/jander99/skills --skill spring-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spring-testing
Source: https://github.com/jander99/skills/tree/main/skills/spring-testing
Command: npx skills add https://github.com/jander99/skills --skill spring-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Spring Boot testing is complex and time-consuming; this skill guides you in selecting the right test types, configuring minimal Spring contexts, and debugging test failures effectively.

Core Features & Use Cases

  • Supports unit tests with pure Mockito, slice tests with @WebMvcTest and @DataJpaTest, and full integration tests with @SpringBootTest and Testcontainers.
  • Provides guidance on test organization, naming conventions, and reusable test data patterns (data builders, object mother).
  • Use case: When enhancing a Spring Boot API, apply this skill to validate controllers, services, and repositories with fast feedback and reliable coverage.

Quick Start

Run the Spring Boot testing skill to scaffold unit, slice, and integration tests for your controllers, services, and repositories.

Frequently Asked Questions about spring-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write Spring Boot integration tests using Testcontainers?

Spring Boot integration tests using Testcontainers validate full application contexts by configuring @SpringBootTest with containerized dependencies, ensuring reliable and maintainable test execution across controllers, services, and repositories.

What is the difference between slice testing and unit testing in Spring Boot?

Slice testing in Spring Boot loads minimal application contexts for specific layers like @WebMvcTest or @DataJpaTest, whereas unit testing uses pure Mockito to validate individual components without loading the Spring context.

Can I use Mockito with @WebMvcTest to test Spring Boot controllers?

Yes, you can use Mockito with @WebMvcTest to test Spring Boot controllers by mocking service layers, allowing fast and reliable validation of REST API endpoints without starting a full server context.

What's the best way to organize Spring Boot test data and naming conventions?

The best way to organize Spring Boot test data is applying reusable patterns like data builders and object mother, combined with clear naming conventions to enforce test scope and maintainability across unit and integration tests.

Why does my Spring Boot test context fail to load during slice testing?

Spring Boot test context failures during slice testing often occur when environment configuration guardrails are violated; this skill helps debug context failures by enforcing minimal context configuration and clear testing scope boundaries.