public ZKClientConfig toConfig(Path configFile) throws IOException, QuorumPeerConfig.ConfigException {
        String configString = toConfigString();
        Files.createDirectories(configFile.getParent());
        Path tempFile = Files.createTempFile(configFile.toAbsolutePath().getParent(), "." + configFile.getFileName(), ".tmp");
        Files.writeString(tempFile, configString);
        Files.move(tempFile, configFile, StandardCopyOption.ATOMIC_MOVE);
        return new ZKClientConfig(configFile.toString());
    }
@Test
    void config_when_using_system_tls_context() {
        ZkClientConfigBuilder builder = new ZkClientConfigBuilder(new MockTlsContext());
        ZKClientConfig config = builder.toConfig();
        assertEquals("true", config.getProperty(CLIENT_SECURE_PROPERTY));
        assertEquals("org.apache.zookeeper.ClientCnxnSocketNetty", config.getProperty(CLIENT_CONNECTION_SOCKET));
        assertEquals("TLSv1.3", config.getProperty(SSL_ENABLED_PROTOCOLS_PROPERTY));
        assertEquals("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", config.getProperty(SSL_ENABLED_CIPHERSUITES_PROPERTY));
        assertEquals("NEED", config.getProperty(SSL_CLIENTAUTH_PROPERTY));
        assertEquals(VespaSslContextProvider.class.getName(), config.getProperty(SSL_CONTEXT_SUPPLIER_CLASS_PROPERTY));
    }