spring-testing

Automate Spring Boot and Kotlin testing patterns across multi-module projects.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides proven testing patterns and practical guidance for Spring Boot + Kotlin projects organized into multiple modules, helping teams write reliable unit, integration, and API tests while debugging test infrastructure.

Core Features & Use Cases

  • Module-oriented testing strategies across domain (unit tests with MockK), infra (integration tests with Testcontainers), app-api (slice tests with @WebMvcTest + REST Docs), and client-ext (HTTP stubs via WireMock).
  • Test fixture patterns (Object Mother) to build reusable test data for domain models.
  • Concrete MockK usage patterns, testcontainers setup, and REST Docs-based API documentation examples.
  • Comprehensive testing patterns including @DataJpaTest for repository slices and anti-pattern awareness to keep tests isolated and maintainable.

Quick Start

Follow the patterns in this guide to scaffold and improve your Spring Boot + Kotlin tests across modules.

Frequently Asked Questions about spring-testing

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

FAQPage Schema
How do I structure Spring Boot tests for a Kotlin multi-module project?

Structure Spring Boot tests by applying module-oriented strategies: unit tests with MockK for domain, integration tests with Testcontainers for infra, and slice tests with @WebMvcTest for app-api. This ensures reliable testing across isolated modules and maintainable test infrastructure.

What is the best way to set up Testcontainers for Spring Boot integration tests?

Set up Testcontainers for Spring Boot integration tests by defining reusable configurations within the infra module. This approach provides isolated, disposable database environments for integration testing, ensuring reliable execution without manual container management.

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

Yes, you can use MockK with @WebMvcTest to test Spring Boot REST controllers in the app-api module. This combination slices the web layer for focused controller testing and integrates with REST Docs to generate API documentation from your test cases.

How do I create reusable test data fixtures for Kotlin domain models?

Create reusable test data fixtures for Kotlin domain models using the Object Mother pattern. This pattern centralizes test data construction, ensuring consistent domain object creation across unit tests while maintaining isolation and reducing test setup duplication.

Does this testing pattern support @DataJpaTest for repository slices?

Yes, this testing pattern supports @DataJpaTest for repository slices within the infra module. It provides comprehensive testing patterns that include repository slice testing and anti-pattern awareness to keep database tests isolated and maintainable.

Why should I avoid anti-patterns when writing Spring Boot slice tests?

Avoiding anti-patterns in Spring Boot slice tests prevents cross-module dependencies from leaking into isolated test contexts. The Skill defines anti-pattern awareness to keep tests maintainable, ensuring @WebMvcTest and @DataJpaTest slices remain fast and focused.