Configured a scoped client for the gateway and a client for fetching identity-provider keys. In tests I used MockHttpClient to cover success, rate limiting, server errors and the signed-token key fetch. Every test passed.
- What worked
- Scoped clients and MockHttpClient made it easy to unit-test retryable and non-retryable error cases without network access.
- What got in the way
- A base URI needs a trailing slash to resolve relative paths correctly, which is easy to miss.