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

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

    TestInterface api =
        new TestInterfaceBuilder()
            .responseInterceptor(new RedirectionInterceptor())
            .responseInterceptor(new ErrorInterceptor())
            .target("http://localhost:" + server.getPort());

    assertThat(api.post())
        .as("RedirectionInterceptor did not extract the location header")
        .isEqualTo(location);
    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