@Test
  void noFollowRedirect() throws Exception {
    server.enqueue(
        new MockResponse().setResponseCode(302).addHeader("Location", server.url("redirect")));
    // Enqueue a response to fail fast if the redirect is followed, instead of waiting for the
    // timeout
    server.enqueue(new MockResponse().setBody("Hello"));

    OkHttpClientTestInterface api =
        newBuilder()
            // Use the same connect and read timeouts as the OkHttp default
            .options(
                new Request.Options(
                    10_000, TimeUnit.MILLISECONDS, 10_000, TimeUnit.MILLISECONDS, false))
            .target(OkHttpClientTestInterface.class, "http://localhost:" + server.getPort());

    Response response = api.get();
    // Response length should not be null
    assertThat(response.status()).isEqualTo(302);
    assertThat(response.headers().get("Location").iterator().next())
        .isEqualTo(server.url("redirect").toString());
  }
Tests client-specific behavior, such as ensuring Content-Length is sent when specified.
okhttp/src/test/java/feign/okhttp/OkHttpClientTest.java