public static ClickHouseNode getClickHouseNode(ClickHouseProtocol protocol, int port) {
        String host = clickhouseServer;

        if (isCloud) {
            host = System.getenv("CLICKHOUSE_CLOUD_HOST");
            port = 8443;
            return ClickHouseNode.builder().
                    address(protocol, new InetSocketAddress(host, port))
                    .credentials(new ClickHouseCredentials("default", getPassword()))
                    .database(database)
                    .build();
        }
        if (clickhouseContainer != null) {
            host = clickhouseContainer.getHost();
            port = clickhouseContainer.getMappedPort(port);
        }
        return ClickHouseNode.builder().address(protocol, new InetSocketAddress(host, port)).build();
    }
Adaptive ClickHouse server environment for integration test. Two modes are
supported: 1) existing server(when system property {@code clickhouseServer}
is defined); and 2) test container.

<p>
Below system properties can be used for customization:
<ul>
<li>clickhouseServer - host of clickhouse server</li>
<li>clickhouse&lt;Protocol&gt;Port - port of specific protocol, for example:
{@code clickhouseGRPCPort}</li>
<li>clickhouseImage - custom docker image, with or without tag and/or image
digest</li>
<li>clickhouseVersion - version of clickhouse, could be replaced by the one
used in {@code clickhouseImage}</li>
<li>clickhouseTimezone - server timezone</li>
<li>additionalPackages - additional system packages should be installed in
container mode</li>
</ul>
clickhouse-client/src/test/java/com/clickhouse/client/ClickHouseServerForTest.java