//! Shared test helpers: spin up a wiremock server and point a Client at it.

use ticksupply::Client;
use wiremock::MockServer;

pub async fn mock_client() -> (MockServer, Client) {
    let server = MockServer::start().await;
    let client = Client::builder()
        .api_key("key_test.secret")
        .base_url(format!("{}/v1", server.uri()))
        .max_retries(0) // keep tests fast and deterministic
        .build()
        .expect("client builds");
    (server, client)
}
