@VisibleForTesting
    static GrpcConfig extractGrpcQueryClientConfig(PinotConfig config)
    {
        Map<String, Object> target = new HashMap<>();
        target.put(CONFIG_USE_PLAIN_TEXT, !config.isUseSecureConnection());
        target.put(CONFIG_MAX_INBOUND_MESSAGE_BYTES_SIZE, config.getStreamingServerGrpcMaxInboundMessageBytes());
        if (config.isUseSecureConnection()) {
            setOrRemoveProperty(target, "tls.keystore.path", config.getGrpcTlsKeyStorePath());
            setOrRemoveProperty(target, "tls.keystore.password", config.getGrpcTlsKeyStorePassword());
            setOrRemoveProperty(target, "tls.keystore.type", config.getGrpcTlsKeyStoreType());
            setOrRemoveProperty(target, "tls.truststore.path", config.getGrpcTlsTrustStorePath());
            setOrRemoveProperty(target, "tls.truststore.password", config.getGrpcTlsTrustStorePassword());
            setOrRemoveProperty(target, "tls.truststore.type", config.getGrpcTlsTrustStoreType());
        }
        return new GrpcConfig(target);
    }
@Test
    public void testExtractTlsPropertySpecified()
    {
        PinotConfig config = new PinotConfig()
                .setGrpcTlsTrustStorePassword("changeit1")
                .setGrpcTlsTrustStoreType("jks-truststore")
                .setGrpcTlsTrustStorePath("/path/to/truststore/file.jks")
                .setGrpcTlsKeyStorePath("/path/to/keystore/file.jks")
                .setGrpcTlsKeyStorePassword("changeit2")
                .setGrpcTlsKeyStoreType("jks-keystore")
                .setUseSecureConnection(true);

        GrpcConfig extracted = PinotPageSourceProvider.extractGrpcQueryClientConfig(config);
        assertEquals(extracted.getMaxInboundMessageSizeBytes(), DEFAULT_STREAMING_SERVER_GRPC_MAX_INBOUND_MESSAGE_BYTES);
        assertFalse(extracted.isUsePlainText());
        assertNotNull(extracted.getTlsConfig());
        assertEquals(extracted.getTlsConfig().getKeyStorePath(), "/path/to/keystore/file.jks");
        assertEquals(extracted.getTlsConfig().getKeyStoreType(), "jks-keystore");
        assertEquals(extracted.getTlsConfig().getKeyStorePassword(), "changeit2");
        assertEquals(extracted.getTlsConfig().getTrustStorePath(), "/path/to/truststore/file.jks");
        assertEquals(extracted.getTlsConfig().getTrustStorePassword(), "changeit1");
        assertEquals(extracted.getTlsConfig().getTrustStoreType(), "jks-truststore");
    }