Spring Boot
Use Mokksy as a mock HTTP server in Spring Boot integration tests by pointing application properties, RestClient, or WebClient at mokksy.baseUrl().
Use Mokksy in Spring Boot when your application calls an external HTTP dependency through
configuration, RestClient, WebClient, or another HTTP client bean.
1Spring Boot test -> application HTTP client -> Mokksy -> stubbed external API
Typical setup
- Start Mokksy in the test fixture.
- Inject
mokksy.baseUrl()into the property your application uses for the external base URL. - Register stubs before the application code makes the call.
- Execute the real Spring Boot behavior and verify the request journal.
In practice, step 2 usually means overriding the Spring configuration property that holds the outbound service URL during test startup, rather than changing production bean wiring by hand.
This works well for payment gateways, fraud or risk APIs, telecom provisioning services, document pipelines, and internal platform dependencies.
Where to go next
This is a routing guide for Spring Boot projects. Use the linked Mokksy pages for the tested stub and verification APIs, and override your application's external base-URL property in the test profile or test fixture.
- First integration test for the end-to-end test shape
- Stubbing responses for response DSL examples
- Request matching for path, header, and body matching
If the dependency is OpenAI, Anthropic, Gemini, Ollama, or A2A, use AI-Mocks instead of raw Mokksy.