A local HTTP server to point a provider client at, so a test exercises the client's real request and response handling - including streaming - without a network or an API key.
It is the JDK's com.sun.net.httpserver.HttpServer on an ephemeral port, so it adds no dependency.
holdOpen and streamThenHold are handlers that never finish answering, for checking that a client's call can be interrupted (see ProviderModuleChecks.assertCancelsWhenInterrupted). Handlers run on virtual threads, so this needs JDK 21 (see docs/guide/writing-a-provider.md).
Holds the request open without answering until the enclosing withServer block ends - a provider that never replies, for checking that a client's call can be interrupted.
Holds the request open without answering until the enclosing withServer block ends - a provider that never replies, for checking that a client's call can be interrupted.
Starts a local HTTP server with handler bound to path, runs test with the server's base URL (http://localhost:<port>, no trailing slash), then stops the server - also when test throws, whose exception is then rethrown.
Starts a local HTTP server with handler bound to path, runs test with the server's base URL (http://localhost:<port>, no trailing slash), then stops the server - also when test throws, whose exception is then rethrown.