@Test
    void initializeAndShutdown() throws Exception {
        String appName = "app-" + UUID.randomUUID();
        ServerSocket serverSocket = new ServerSocket(0);
        InetSocketAddress serverSocketAddress = (InetSocketAddress) serverSocket.getLocalSocketAddress();
        String serverHostname = serverSocketAddress.getHostName();
        int serverPort = serverSocketAddress.getPort();
        OriginName originName = OriginName.fromVipAndApp("vip", appName);
        DefaultClientConfigImpl clientConfig = new DefaultClientConfigImpl();

        Server.defaultOutboundChannelType.set(NioSocketChannel.class);

        InstanceInfo instanceInfo = InstanceInfo.Builder.newBuilder()
                .setAppName(appName)
                .setHostName(serverHostname)
                .setPort(serverPort)
                .build();
        DiscoveryResult discoveryResult = DiscoveryResult.from(instanceInfo, true);

        DynamicServerResolver resolver = mock(DynamicServerResolver.class);
        when(resolver.resolve(any())).thenReturn(discoveryResult);
        when(resolver.hasServers()).thenReturn(true);

        Registry registry = new DefaultRegistry();
        DefaultClientChannelManager clientChannelManager =
                new DefaultClientChannelManager(originName, clientConfig, resolver, registry);

        NioEventLoopGroup eventLoopGroup = new NioEventLoopGroup(10);
        EventLoop eventLoop = eventLoopGroup.next();

        clientChannelManager.init();

        Truth.assertThat(clientChannelManager.getConnsInUse()).isEqualTo(0);

        Promise<PooledConnection> promiseConn = clientChannelManager.acquire(eventLoop);
        promiseConn.await(200, TimeUnit.MILLISECONDS);
        assertTrue(promiseConn.isDone());
        assertTrue(promiseConn.isSuccess());

        PooledConnection connection = promiseConn.get();
        assertTrue(connection.isActive());
        assertFalse(connection.isInPool());

        Truth.assertThat(clientChannelManager.getConnsInUse()).isEqualTo(1);

        boolean releaseResult = clientChannelManager.release(connection);
        assertTrue(releaseResult);
        assertTrue(connection.isInPool());

        Truth.assertThat(clientChannelManager.getConnsInUse()).isEqualTo(0);

        clientChannelManager.shutdown();
        serverSocket.close();
    }
Tests for {@link DefaultClientChannelManager}.  These tests don't use IPv6 addresses because {@link InstanceInfo} is
not capable of expressing them.
zuul-core/src/test/java/com/netflix/zuul/netty/connectionpool/DefaultClientChannelManagerTest.java