@Test
public void testGetConnection() throws Exception {

  Map<ConnectionPoolId, ConnectionPool> poolMap = connManager.getPools();
  final int totalConns = 10;
  int activeConns = 5;
  ConnectionPool pool = new ConnectionPool(
      conf, TEST_NN_ADDRESS, TEST_USER1, 0, 10, 0.5f, ClientProtocol.class);
  addConnectionsToPool(pool, totalConns, activeConns);
  poolMap.put(
      new ConnectionPoolId(TEST_USER1, TEST_NN_ADDRESS, ClientProtocol.class),
      pool);
  // All remaining connections should be usable
  final int remainingSlots = totalConns - activeConns;
  for (int i = 0; i < remainingSlots; i++) {
    ConnectionContext cc = pool.getConnection();
    assertTrue(cc.isUsable());
    cc.getClient();
    activeConns++;
  }
  checkPoolConnections(TEST_USER1, totalConns, activeConns);
  // Ask for more and this returns an active connection
  ConnectionContext cc = pool.getConnection();
  assertTrue(cc.isActive());
}