The Spring Boot API Mocking Hub
The complete roadmap for mocking external APIs in Spring Boot. Navigate strictly organized guides for REST, GraphQL, XML, Microservices, and debugging.
Welcome to the definitive collection of guides for testing external dependencies in Spring Boot. Whether you are mocking a simple REST endpoint, orchestrating microservices, or dealing with legacy SOAP, start your journey here.
🚀 The Essentials
Start here if you are new to integration testing.
- The Master Tutorial How to set up your first mock test.
- REST APIs (RestTemplate/WebClient) Standard JSON service mocking.
- Feign Clients Testing declarative HTTP clients.
⚛️ Advanced Protocols
Beyond simple REST/JSON interactions.
- GraphQL APIs Matching specific queries and variables.
- XML & SOAP Services Handling namespaces and legacy headers.
🧩 Complex Scenarios
Real-world problems require robust solutions.
- Handling Dynamic Fields Ignoring timestamps, UUIDs, and random tokens.
- Microservices & Pagination Mocking multiple upstreams and stateful loops.
- Pure JUnit 5 (No Spring) Lightweight testing without the ApplicationContext.
🛠️ Tools & Debugging
Fixing broken tests and choosing the right tech.
-
Debugging & Reports
Using
showMatchesand generating HTML reports. - StableMock vs WireMock Understanding the relationship and differences.
- Best Mocking Tools (2026) A landscape comparison of available libraries.
Missing Something?
The StableMock ecosystem is constantly evolving. If you have a specific testing scenario not covered here (e.g., gRPC, WebSockets), check back soon or contribute to the discussion on GitHub.
Visit GitHub Repo