@Test
  void responseInterceptorChainOrder() throws Exception {
    String location = "https://redirect.example.com";
    String redirectBody = "Not the location";
    server.enqueue(
        new MockResponse()
            .setResponseCode(302)
            .setHeader("Location", location)
            .setBody(redirectBody));

    String body = "One moment, please.";
    server.enqueue(new MockResponse().setResponseCode(503).setBody(body));

    // ErrorInterceptor WILL extract the body of redirects, so we re-order our
    // interceptors to
    // verify that chain ordering is maintained
    TestInterface api =
        new TestInterfaceBuilder()
            .responseInterceptors(List.of(new ErrorInterceptor(), new RedirectionInterceptor()))
            .target("http://localhost:" + server.getPort());

    assertThat(api.post())
        .as("RedirectionInterceptor did not extract the redirect response body")
        .isEqualTo(redirectBody);
    assertThat(api.post())
        .as("ResponseInterceptor did not extract the response body")
        .isEqualTo(body);
  }
when you must parse a 2xx status to determine if the operation succeeded or not.
core/src/test/java/feign/FeignTest.java