@Test
  public void testConnectionRefused() throws Exception {
    String connectionId =
        selector.connect(new InetSocketAddress("localhost", 6668), DEFAULT_SOCKET_BUF_SIZE, DEFAULT_SOCKET_BUF_SIZE,
            PortType.SSL);
    while (selector.disconnected().contains(connectionId)) {
      selector.poll(1000L);
    }
  }
Sending a request to a node not listening on that port should result in disconnection
ambry-network/src/test/java/com/github/ambry/network/SSLSelectorTest.java