marcelorodrigo avatar

Spring Boot Testing

This is a comprehensive testing guide for Spring Boot 4 that actually tells you which annotation to use when. It's built around the test pyramid and includes decision trees for choosing between @WebMvcTest, @DataJpaTest, @RestClientTest, and friends. The best part is the practical coverage: it shows you MockMvcTester (the new AssertJ-style API), Testcontainers for real database tests, and Instancio for generating test data. It also covers the Spring Boot 4 migration path from deprecated @MockBean to @MockitoBean. The complexity assessment section is refreshingly honest about when to refactor instead of writing 50 test cases for a god method. If you're moving to Spring Boot 4 or just tired of guessing which test slice to use, this gets you unstuck fast.

skills.sh installs
215
GitHub stars
19
last updated
Aug 21, 2026

Install

$ npx -y skills add marcelorodrigo/agent-skills --skill spring-boot-testing --agent claude-code

Installs into .claude/skills of the current project.

Files

Spring Boot Testing

Expert guide for testing Spring Boot 4 applications with modern patterns and best practices.

Core Principles

  1. Test Pyramid: Unit (fast) > Slice (focused) > Integration (complete)
  2. Right Tool: Use the narrowest slice that gives you confidence
  3. AssertJ Style: Fluent, readable assertions over verbose matchers
  4. Modern APIs: Prefer MockMvcTester and RestTestClient over legacy alternatives

Which Test Slice?

ScenarioAnnotationReference
Controller + HTTP semantics@WebMvcTestreferences/webmvctest.md
Repository + JPA queries@DataJpaTestreferences/datajpatest.md
REST client + external APIs@RestClientTestreferences/restclienttest.md
JSON (de)serialization@JsonTestSee references/test-slices-overview.md
Full application@SpringBootTestSee references/test-slices-overview.md

Test Slices Reference

Sponsors

Details

Repository
github.com/marcelorodrigo/agent-skills
Categories
Testing & QA, AI & Agent Building, Java & JVM
First seen
Jun 3, 2026

More from marcelorodrigo/agent-skills

All 4
1vudovn avatarwebapp-testingvudovn/antigravity-kitwebapp testing212skills.sh installs
2akillness avatarbackend-testingakillness/oh-my-skillsbackend testing211skills.sh installs
3sickn33 avatarbats-testing-patternssickn33/antigravity-awesome-skillsbats testing patterns206skills.sh installs
4royrvd avatartesting-best-practicesroyrvd/golden-testing-rules-for-aitesting best practices204skills.sh installs
5vercel-labs avatarbenchmark-testingvercel-labs/vercel-pluginbenchmark testing193skills.sh installs
6davila7 avatarplaywrightdavila7/claude-code-templatesUse when the task requires automating a real browser from the terminal (navigation, form filling, snapshots, screenshots, data extraction, UI-flow debugging) vi185skills.sh installs