@Test
  void redirectionInterceptorCollection() throws Exception {
    String location = "https://redirect.example.com";
    Collection<String> locations = Collections.singleton("https://redirect.example.com");

    server.enqueue(new MockResponse().setResponseCode(302).setHeader("Location", location));

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

    Collection<String> response = api.collection();
    assertThat(response.size())
        .as("RedirectionInterceptor did not extract the location header")
        .isEqualTo(locations.size());
    assertThat(response.contains(location))
        .as("RedirectionInterceptor did not extract the location header")
        .isTrue();
  }
when you must parse a 2xx status to determine if the operation succeeded or not.
core/src/test/java/feign/FeignTest.java