public static ConnectedChannel getBlockingChannelBasedOnPortType(Port targetPort, String hostName,
      SSLSocketFactory sslSocketFactory, SSLConfig sslConfig) {
    ConnectedChannel channel = null;
    if (targetPort.getPortType() == PortType.PLAINTEXT) {
      channel = new BlockingChannel(hostName, targetPort.getPort(), 10000, 10000, 10000, 2000);
    } else if (targetPort.getPortType() == PortType.SSL) {
      channel = new SSLBlockingChannel(hostName, targetPort.getPort(), new MetricRegistry(), 10000, 10000, 10000, 4000,
          sslSocketFactory, sslConfig);
    } else if (targetPort.getPortType() == PortType.HTTP2) {
      channel = new Http2BlockingChannel(hostName, targetPort.getPort(), sslConfig,
          new Http2ClientConfig(new VerifiableProperties(new Properties())),
          new Http2ClientMetrics(new MetricRegistry()));
    }
    return channel;
  }
Returns BlockingChannel, SSLBlockingChannel or Http2BlockingChannel depending on whether the port type is PlainText,
SSL or HTTP2 port for the given targetPort
@param targetPort upon which connection has to be established
@param hostName upon which connection has to be established
@return ConnectedChannel
ambry-test-utils/src/main/java/com/github/ambry/server/ServerTestUtil.java