
Spring Boot Testing
This is a comprehensive testing guide for Spring Boot 4 applications that cuts through the noise with a clear decision tree: use @WebMvcTest for controllers, @DataJpaTest for repositories, and plain JUnit for business logic. It emphasizes modern tools like MockMvcTester and RestTestClient over legacy alternatives, pairs everything with AssertJ for readable assertions, and includes practical references for each test slice. The best practices section is pragmatic, recommending 80% coverage with Jacoco and suggesting refactoring when a method needs more than 5-7 test cases. It's opinionated about the test pyramid and context caching, which is exactly what you want when learning a testing stack this deep.
- skills.sh installs
- 2.1K
- GitHub stars
- 41K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add github/awesome-copilot --skill spring-boot-testing --agent claude-codeInstalls into .claude/skills of the current project.
Files
Spring Boot Testing
This skill provides expert guidance for testing Spring Boot applications with modern patterns and best practices. Examples target Spring Boot 4; see the compatibility note below for Boot 3.
Compatibility: detect first
Read the project's Spring Boot version and test dependencies before writing tests, and do not upgrade them implicitly.
| Spring Boot 3.x | Spring Boot 4.x | |
|---|---|---|
| JUnit | 5 (Jupiter) | 6 by default (same org.junit.jupiter.api annotations; JUnit 5 tests keep working) |
| Mock beans | @MockitoBean / @MockitoSpyBean from 3.4 (Spring Framework 6.2); @MockBean / @SpyBean are deprecated | @MockitoBean replaces @MockBean (do not use the old ones) |
| Test starters | spring-boot-starter-test covers everything | modular: add spring-boot-starter-webmvc-test, spring-boot-starter-data-jpa-test, ... |
| Slice imports | org.springframework.boot.test.autoconfigure... | moved, e.g. org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest |
| Testcontainers | 1.x names | 2.x names (testcontainers-postgresql) |
Sponsors
Details
- Repository
- github.com/github/awesome-copilot
- Categories
- Testing & QA, Git & Pull Requests, AI & Agent Building, Java & JVM
- First seen
- Apr 16, 2026
More from github/awesome-copilot
All 318- Codeql2K
- Microsoft Agent Framework2K
- Flowstudio Power Automate Build1.9K
- Flowstudio Power Automate Debug1.9K
- Issue Fields Migration1.9K
- Gtm Positioning Strategy1.9K
- Publish To Pages1.9K
- Reviewing Oracle To Postgres Migration1.8K
- Gtm Product Led Growth1.8K
- Migrating Oracle To Postgres Stored Procedures1.8K
- Creating Oracle To Postgres Migration Integration Tests1.8K
- Unit Test Vue Pinia1.8K
- Creating Oracle To Postgres Master Migration Plan1.8K
- Creating Oracle To Postgres Migration Bug Report1.8K
- Oo Component Documentation1.8K
- Planning Oracle To Postgres Migration Integration Testing1.8K
- Scaffolding Oracle To Postgres Migration Test Project1.7K
- Gtm 0 To 1 Launch1.7K
- Gdpr Compliant1.7K
- Sandbox Npm Install1.7K
- Semantic Kernel1.7K
- Gtm Technical Product Pricing1.7K
- Aws Cdk Python Setup1.7K
- Gtm Ai Gtm1.6K