SpringWebFluxServerHttpExchange extends AbstractServerHttpExchange { @Override public <T> T unwrap(Class<T> clazz) { return ServerRequest.class.isAssignableFrom(clazz) ? clazz.cast(request) : ServerHttpResponse.class.isAssignableFrom(clazz) ? clazz.cast(response) : null; } SpringWebFluxServerHttpExchange(ServerRequest request); @Override String uri(); @Override HttpMethod method(); @Override Set<String> headerNames(); @Override List<String> headers(String name); @Override T unwrap(Class<T> clazz);  }
@Test public void unwrap() throws Throwable { requestAction(http -> { threadAssertTrue(http.unwrap(ServerRequest.class) instanceof ServerRequest); threadAssertTrue(http.unwrap(ServerHttpResponse.class) instanceof ServerHttpResponse); resume(); }); client.newRequest(uri()).send(new Response.Listener.Adapter()); await(); }