@Test
  public void connectedServerCount() throws Exception {
    int port3 = getRandomAvailableTCPPort();

    PoolFactory poolFactory = PoolManager.createFactory();
    poolFactory.addServer("localhost", port3);
    poolFactory.setSubscriptionEnabled(false);
    poolFactory.setReadTimeout(2000);
    poolFactory.setMinConnections(1);
    poolFactory.setSocketBufferSize(32768);
    poolFactory.setRetryAttempts(1);
    poolFactory.setPingInterval(500);
    proxy = (PoolImpl) poolFactory.create("clientPool");

    assertThatThrownBy(() -> proxy.acquireConnection())
        .isInstanceOf(NoAvailableServersException.class);

    assertThat(proxy.getConnectedServerCount()).isEqualTo(0);
    addCacheServer(port3, 15000);
    await().untilAsserted(() -> {
      assertThat(proxy.getConnectedServerCount()).isEqualTo(1);
    });

  }
Tests the functionality of operations of AbstractConnectionProxy & its derived classes.
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/tier/sockets/ConnectionProxyIntegrationTest.java