NetworkClient implements KafkaClient { @Override public long connectionDelay(Node node, long now) { return connectionStates.connectionDelay(node.idString(), now); } NetworkClient(Selectable selector,
        Metadata metadata,
        String clientId,
        int maxInFlightRequestsPerConnection,
        long reconnectBackoffMs,
        int socketSendBuffer,
        int socketReceiveBuffer,
        int requestTimeoutMs,
        Time time);  NetworkClient(Selectable selector,
        MetadataUpdater metadataUpdater,
        String clientId,
        int maxInFlightRequestsPerConnection,
        long reconnectBackoffMs,
        int socketSendBuffer,
        int socketReceiveBuffer,
        int requestTimeoutMs,
        Time time); private  NetworkClient(MetadataUpdater metadataUpdater,
        Metadata metadata,
        Selectable selector,
        String clientId,
        int maxInFlightRequestsPerConnection,
        long reconnectBackoffMs,
        int socketSendBuffer,
        int socketReceiveBuffer,
        int requestTimeoutMs,
        Time time); @Override boolean ready(Node node, long now); @Override void close(String nodeId); @Override long connectionDelay(Node node, long now); @Override boolean connectionFailed(Node node); @Override boolean isReady(Node node, long now); @Override void send(ClientRequest request, long now); @Override List<ClientResponse> poll(long timeout, long now); @Override int inFlightRequestCount(); @Override int inFlightRequestCount(String node); @Override RequestHeader nextRequestHeader(ApiKeys key); @Override RequestHeader nextRequestHeader(ApiKeys key, short version); @Override void wakeup(); @Override void close(); @Override Node leastLoadedNode(long now); static Struct parseResponse(ByteBuffer responseBuffer, RequestHeader requestHeader);  }
@Test public void testConnectionDelay() { long now = time.milliseconds(); long delay = client.connectionDelay(node, now); assertEquals(0, delay); }
@Test public void testConnectionDelayConnected() { awaitReady(client, node); long now = time.milliseconds(); long delay = client.connectionDelay(node, now); assertEquals(Long.MAX_VALUE, delay); }