@SuppressWarnings("deprecation")
@Test
public void whenReturnTypeIsResponseNoErrorHandling() throws Throwable {

  Map<String, Collection<String>> headers = new LinkedHashMap<String, Collection<String>>();
  headers.put("Location", Arrays.asList("http://bar.com"));
  final Response response = Response.builder().status(302).reason("Found").headers(headers)
      .request(Request.create(HttpMethod.GET, "/", Collections.emptyMap(), null, Util.UTF_8))
      .body(new byte[0]).build();
  ExecutorService execs = Executors.newSingleThreadExecutor();
  // fake client as Client.Default follows redirects.
  TestInterfaceAsync api = AsyncFeign.<Void>asyncBuilder()
      .client(new AsyncClient.Default<>((request, options) -> response, execs))
      .target(TestInterfaceAsync.class, "http://localhost:" + server.getPort());
  assertEquals(Collections.singletonList("http://bar.com"),
      unwrap(api.response()).headers().get("Location"));
  execs.shutdown();
}