Configuration getEffectiveConfiguration(String[] args) throws CliArgsException {
        final CommandLine commandLine = cli.parseCommandLineOptions(args, true);
        final Configuration effectiveConfiguration = new Configuration(baseConfiguration);
        effectiveConfiguration.addAll(cli.toConfiguration(commandLine));
        effectiveConfiguration.set(DeploymentOptions.TARGET, KubernetesSessionClusterExecutor.NAME);
        return effectiveConfiguration;
    }
@Test
    void testDynamicProperties() throws Exception {

        final KubernetesSessionCli cli =
                new KubernetesSessionCli(
                        new Configuration(), confDirPath.toAbsolutePath().toString());
        final String[] args =
                new String[] {
                    "-e",
                    KubernetesSessionClusterExecutor.NAME,
                    "-Dpekko.ask.timeout=5 min",
                    "-Denv.java.opts=-DappName=foobar"
                };

        final Configuration executorConfig = cli.getEffectiveConfiguration(args);
        final ClusterClientFactory<String> clientFactory = getClusterClientFactory(executorConfig);

        assertThat(clientFactory).isNotNull();

        final Map<String, String> executorConfigMap = executorConfig.toMap();
        assertThat(executorConfigMap).hasSize(4);
        assertThat(executorConfigMap)
                .contains(
                        entry("pekko.ask.timeout", "5 min"),
                        entry("env.java.opts", "-DappName=foobar"));
        assertThat(executorConfig.get(DeploymentOptionsInternal.CONF_DIR))
                .isEqualTo(confDirPath.toAbsolutePath().toString());
        assertThat(executorConfigMap).containsKey(DeploymentOptions.TARGET.key());
    }