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

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

    Throwable exception = assertThrows(FeignException.class, () -> api.post());
    assertThat(exception.getMessage()).contains("timeout reading POST http://");
  }
when you must parse a 2xx status to determine if the operation succeeded or not.
core/src/test/java/feign/FeignTest.java