TcpServerTransport implements ServerTransport<CloseableChannel> { public static TcpServerTransport create(int port) { TcpServer server = TcpServer.create().port(port); return create(server); } private  TcpServerTransport(TcpServer server, int maxFrameLength); static TcpServerTransport create(int port); static TcpServerTransport create(String bindAddress, int port); static TcpServerTransport create(InetSocketAddress address); static TcpServerTransport create(TcpServer server); static TcpServerTransport create(TcpServer server, int maxFrameLength); @Override int maxFrameLength(); @Override Mono<CloseableChannel> start(ConnectionAcceptor acceptor);  }
@DisplayName("creates server with BindAddress") @Test void createBindAddress() { assertThat(TcpServerTransport.create("test-bind-address", 8000)).isNotNull(); }
@DisplayName("creates server with InetSocketAddress") @Test void createInetSocketAddress() { assertThat( TcpServerTransport.create( InetSocketAddress.createUnresolved("test-bind-address", 8000))) .isNotNull(); }
@DisplayName("create throws NullPointerException with null bindAddress") @Test void createNullBindAddress() { assertThatNullPointerException() .isThrownBy(() -> TcpServerTransport.create((String) null, 8000)) .withMessage("bindAddress must not be null"); }
@DisplayName("create throws NullPointerException with null address") @Test void createNullInetSocketAddress() { assertThatNullPointerException() .isThrownBy(() -> TcpServerTransport.create((InetSocketAddress) null)) .withMessage("address must not be null"); }
@DisplayName("create throws NullPointerException with null server") @Test void createNullTcpClient() { assertThatNullPointerException() .isThrownBy(() -> TcpServerTransport.create((TcpServer) null)) .withMessage("server must not be null"); }
@DisplayName("creates server with port") @Test void createPort() { assertThat(TcpServerTransport.create("localhost", 8000)).isNotNull(); }
@DisplayName("creates client with TcpServer") @Test void createTcpClient() { assertThat(TcpServerTransport.create(TcpServer.create())).isNotNull(); }