@Test public void shouldClose() { given(mockServerWebSocket.closeHandler(any())).will(invocation -> { Handler<Void> handler = invocation.getArgument(0); handler.handle(null); return mockServerWebSocket; }); session.close(new CloseStatus(1000, "test")).block(); verify(mockServerWebSocket).close((short) 1000, "test"); }
@Override public Mono<Void> close(CloseStatus status) { logger.debug("{}Closing web socket with status '{}'", getLogPrefix(), status); return Mono.create(sink -> getDelegate() .closeHandler(e -> { logger.debug("{}Web socket closed", getLogPrefix()); sink.success(); }) .close((short) status.getCode(), status.getReason())); }
VertxWebSocketSession extends AbstractWebSocketSession<WebSocketBase> { @Override public Mono<Void> close(CloseStatus status) { logger.debug("{}Closing web socket with status '{}'", getLogPrefix(), status); return Mono.create(sink -> getDelegate() .closeHandler(e -> { logger.debug("{}Web socket closed", getLogPrefix()); sink.success(); }) .close((short) status.getCode(), status.getReason())); } }
VertxWebSocketSession extends AbstractWebSocketSession<WebSocketBase> { @Override public Mono<Void> close(CloseStatus status) { logger.debug("{}Closing web socket with status '{}'", getLogPrefix(), status); return Mono.create(sink -> getDelegate() .closeHandler(e -> { logger.debug("{}Web socket closed", getLogPrefix()); sink.success(); }) .close((short) status.getCode(), status.getReason())); } VertxWebSocketSession(WebSocketBase delegate, HandshakeInfo handshakeInfo, BufferConverter bufferConverter,
        int maxWebSocketFrameSize, int maxWebSocketMessageSize); }
VertxWebSocketSession extends AbstractWebSocketSession<WebSocketBase> { @Override public Mono<Void> close(CloseStatus status) { logger.debug("{}Closing web socket with status '{}'", getLogPrefix(), status); return Mono.create(sink -> getDelegate() .closeHandler(e -> { logger.debug("{}Web socket closed", getLogPrefix()); sink.success(); }) .close((short) status.getCode(), status.getReason())); } VertxWebSocketSession(WebSocketBase delegate, HandshakeInfo handshakeInfo, BufferConverter bufferConverter,
        int maxWebSocketFrameSize, int maxWebSocketMessageSize); @Override Flux<WebSocketMessage> receive(); @Override Mono<Void> send(Publisher<WebSocketMessage> messages); @Override Mono<Void> close(CloseStatus status); }
VertxWebSocketSession extends AbstractWebSocketSession<WebSocketBase> { @Override public Mono<Void> close(CloseStatus status) { logger.debug("{}Closing web socket with status '{}'", getLogPrefix(), status); return Mono.create(sink -> getDelegate() .closeHandler(e -> { logger.debug("{}Web socket closed", getLogPrefix()); sink.success(); }) .close((short) status.getCode(), status.getReason())); } VertxWebSocketSession(WebSocketBase delegate, HandshakeInfo handshakeInfo, BufferConverter bufferConverter,
        int maxWebSocketFrameSize, int maxWebSocketMessageSize); @Override Flux<WebSocketMessage> receive(); @Override Mono<Void> send(Publisher<WebSocketMessage> messages); @Override Mono<Void> close(CloseStatus status);  }