backend-testing

Automate Spring Boot backend tests with JUnit5, MockMvc, and Spring REST Docs.

1|Updated Jan 12, 2026
One-click install
npx skills add https://github.com/stamp-kkookk/digital-stamp-service --skill backend-testing-stamp-kkookk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-testing
Source: https://github.com/stamp-kkookk/digital-stamp-service/tree/main/.claude/skills/backend-testing
Command: npx skills add https://github.com/stamp-kkookk/digital-stamp-service --skill backend-testing-stamp-kkookk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Write and review backend tests for Spring Boot applications with clear conventions and examples to improve reliability and maintainability.

Core Features & Use Cases

  • JUnit5 + Spring Boot Test for unit, service, and integration tests.
  • MockMvc-based controller tests with structured verification.
  • Mockito-based isolation using @MockitoBean/@MockitoSpyBean and avoiding @MockBean/@SpyBean.
  • Documentation with Spring REST Docs to capture API behavior.

Quick Start

Write a sample controller test following the project conventions to validate a REST endpoint.

Frequently Asked Questions about backend-testing

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

FAQPage Schema
How do I structure Spring Boot backend tests with JUnit5 and MockMvc?

Spring Boot backend tests are structured under src/test/java using JUnit5 and MockMvc. Apply a conventional test package layout with clear naming conventions to organize unit, service, controller, and integration tests for maintainability.

Why use @MockitoBean instead of @MockBean in Spring Boot tests?

Use @MockitoBean and @MockitoSpyBean instead of @MockBean and @SpyBean to isolate dependencies in Spring Boot tests. This approach enforces modern Mockito-based isolation, ensuring reliable mock injection and avoiding deprecated annotation behaviors in your testing guidelines.

Can I generate API documentation from MockMvc controller tests?

Yes, generate API documentation from MockMvc controller tests using Spring REST Docs. This captures actual API behavior during test execution, producing accurate and maintainable documentation directly from your structured Spring Boot test verifications.

What is the best way to write integration tests for Spring Boot REST endpoints?

Write integration tests for Spring Boot REST endpoints using Spring Boot Test with MockMvc. This provides structured verification of request and response payloads while maintaining consistent testing conventions across controller and service layers.

Does this testing convention apply to Java projects outside of Spring Boot?

This testing convention primarily targets Spring Boot applications using JUnit5 and Spring Boot Test. While the basic unit testing guidelines and Mockito isolation practices may apply to general Java projects, the MockMvc and Spring REST Docs integration specifically requires the Spring Boot framework context.