WebsocketServerTransport extends BaseWebsocketServerTransport<WebsocketServerTransport, CloseableChannel> { public static WebsocketServerTransport create(int port) { HttpServer httpServer = HttpServer.create().port(port); return create(httpServer); } private  WebsocketServerTransport(HttpServer server); static WebsocketServerTransport create(int port); static WebsocketServerTransport create(String bindAddress, int port); static WebsocketServerTransport create(InetSocketAddress address); static WebsocketServerTransport create(final HttpServer server); WebsocketServerTransport header(String name, String... values); @Override Mono<CloseableChannel> start(ConnectionAcceptor acceptor);  }
@DisplayName("creates server with BindAddress") @Test void createBindAddress() { assertThat(WebsocketServerTransport.create("test-bind-address", 8000)).isNotNull(); }
@DisplayName("creates server with HttpClient") @Test void createHttpClient() { assertThat(WebsocketServerTransport.create(HttpServer.create())).isNotNull(); }
@DisplayName("creates server with InetSocketAddress") @Test void createInetSocketAddress() { assertThat( WebsocketServerTransport.create( InetSocketAddress.createUnresolved("test-bind-address", 8000))) .isNotNull(); }
@DisplayName("create throws NullPointerException with null bindAddress") @Test void createNullBindAddress() { assertThatNullPointerException() .isThrownBy(() -> WebsocketServerTransport.create(null, 8000)) .withMessage("bindAddress must not be null"); }
@DisplayName("create throws NullPointerException with null client") @Test void createNullHttpClient() { assertThatNullPointerException() .isThrownBy(() -> WebsocketServerTransport.create((HttpServer) null)) .withMessage("server must not be null"); }
@DisplayName("create throws NullPointerException with null address") @Test void createNullInetSocketAddress() { assertThatNullPointerException() .isThrownBy(() -> WebsocketServerTransport.create((InetSocketAddress) null)) .withMessage("address must not be null"); }
@DisplayName("creates server with port") @Test void createPort() { assertThat(WebsocketServerTransport.create(8000)).isNotNull(); }