@Test
  void ensureRetryerClonesItself() throws Throwable {
    server.enqueue(new MockResponse().setResponseCode(503).setBody("foo 1"));
    server.enqueue(new MockResponse().setResponseCode(200).setBody("foo 2"));
    server.enqueue(new MockResponse().setResponseCode(503).setBody("foo 3"));
    server.enqueue(new MockResponse().setResponseCode(200).setBody("foo 4"));

    MockRetryer retryer = new MockRetryer();

    TestInterfaceAsync api =
        AsyncFeign.builder()
            .retryer(retryer)
            .errorDecoder(
                (methodKey, response) ->
                    new RetryableException(
                        response.status(),
                        "play it again sam!",
                        HttpMethod.POST,
                        NON_RETRYABLE,
                        response.request()))
            .target(TestInterfaceAsync.class, "http://localhost:" + server.getPort());

    unwrap(api.post());
    unwrap(api.post()); // if retryer instance was reused, this statement will throw an exception
    assertThat(server.getRequestCount()).isEqualTo(4);
  }
when you must parse a 2xx status to determine if the operation succeeded or not.
core/src/test/java/feign/AsyncFeignTest.java