@Test
  void followRedirect() throws Exception {
    String expectedBody = "Hello";

    server.enqueue(
        new MockResponse().setResponseCode(302).addHeader("Location", server.url("redirect")));
    server.enqueue(new MockResponse().setBody(expectedBody));

    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, true))
            .target(OkHttpClientTestInterface.class, "http://localhost:" + server.getPort());

    Response response = api.get();
    // Response length should not be null
    assertThat(response.status()).isEqualTo(200);
    String payload = Util.toString(response.body().asReader(StandardCharsets.UTF_8));
    assertThat(payload).isEqualTo(expectedBody);
  }
Tests client-specific behavior, such as ensuring Content-Length is sent when specified.
okhttp/src/test/java/feign/okhttp/OkHttpClientTest.java