SpringWebFluxServerWebSocket extends AbstractServerWebSocket { @Override public <T> T unwrap(Class<T> clazz) { return WebSocketSession.class.isAssignableFrom(clazz) ? clazz.cast(session) : null; } SpringWebFluxServerWebSocket(WebSocketSession session); Mono<Void> getMono(); @Override String uri(); @Override Set<String> headerNames(); @Override List<String> headers(String name); @Override T unwrap(Class<T> clazz);  }
@Test public void unwrap() throws Throwable { websocketAction(ws -> { threadAssertTrue(ws.unwrap(WebSocketSession.class) instanceof WebSocketSession); resume(); }); client.connect(new WebSocketAdapter(), URI.create(uri())); await(); }