@Test
  void throwsFeignExceptionIncludingBody() throws Throwable {
    server.enqueue(new MockResponse().setBody("success!"));

    TestInterfaceAsync api =
        AsyncFeign.builder()
            .decoder(
                (response, type) -> {
                  throw new IOException("timeout");
                })
            .target(TestInterfaceAsync.class, "http://localhost:" + server.getPort());

    CompletableFuture<?> cf = api.body("Request body");
    server.takeRequest();
    try {
      unwrap(cf);
    } catch (FeignException e) {
      assertThat(e.getMessage())
          .contains("timeout reading POST http://localhost:" + server.getPort() + "/");
      assertThat(e.contentUTF8()).isEqualTo("Request body");
      return;
    }
    fail("");
  }
when you must parse a 2xx status to determine if the operation succeeded or not.
core/src/test/java/feign/AsyncFeignTest.java