Your Spring AI tests are slow, flaky, and cost money. Here's how to make them deterministic.
You wire up Spring AI, the ChatClient fluent API feels great, your feature works. Then you sit down to write a test — and every good option is bad. A test that calls a real model is: Slow. A hosted call is a second or two; run it on every branch and it adds up. Run inference locally (Ollama + Testcontainers) and a cold call is ~47 s. Either way it's not a loop you run on save. Expensive. Every…
We haven't written up this one. Dev.to has the full story — the link below goes straight to it.